AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Delphi-PRAXiS - Lounge Delphi-News aus aller Welt New Delphi’s Object Pascal Style Guide
Thema durchsuchen
Ansicht
Themen-Optionen

New Delphi’s Object Pascal Style Guide

Ein Thema von DP News-Robot · begonnen am 29. Apr 2021
Antwort Antwort
Benutzerbild von DP News-Robot
DP News-Robot

Registriert seit: 4. Jun 2010
15.473 Beiträge
 
#1

New Delphi’s Object Pascal Style Guide

  Alt 29. Apr 2021, 12:30
Over the last few months I drove an effort to publish a new Object Pascal style guide for today's Delphi language. From the preface:

"This document is an updated version of the classic Object Pascal style guide, originally curated by Charlie Calvert for Borland at the time Delphi was originally released. The updated version has been curated by Delphi Product manager Marco Cantu, with contributions from the internal R&D team, Delphi MVPs, and the Delphi community at large."

The text is not a language guide, rather it covers the use of white space and formatting when writing code -- something the compiler generally ignores. Nothing is mandatory here, this is just a recommendation to favor readability. Following these rules is a requirement for our own internal team and any contributor.

You can find the style guide at http://docwiki.embarcadero.com/RADStudio/Sydney/en/Delphi's_Object_Pascal_Style_Guide .
</br>This is the document index:

  • Introduction
  • General Rules: Identifiers, Keywords, Indentation
  • Source Code Files, Units and Their Structure
  • White Space Usage
  • Comments
  • Statements
  • Type Declarations
I'll end this blog posting the short introduction:

While the Delphi compilers generally ignore any whitespace and allow for a lot of flexibility in the way a developer writes code, for readability and maintainability of the source code, Embarcadero has defined a set of guidelines used by the internal R&D and any developer involved with the project. We recommend the Delphi community at large to adopt this coding and formatting style.

The introduction of the original version of this document expresses this nicely:

“Object Pascal is a beautifully designed language. One of its great virtues is its readability. These standards are designed to enhance that readability of Object Pascal code. When developers follow the simple conventions laid out in this guide, they will be promoting standards that benefit all Delphi developers by using a uniform style that is easy to read. Efforts to enforce these standards will increase the value of a developer's source code, particularly during maintenance and debugging cycles.”
</br>This document does not refer to or explains the language syntax and grammar, as it is only focused on defining code writing style in places where the language gives you a choice, by allowing many different options in terms of whitespace and formatting.


None of these guidelines is set in stone and we expect them to evolve over time along with the language.



Weiterlesen...
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 02:37 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz