Introduction

From RAD Studio
Jump to: navigation, search

Go Up to Delphi’s Object Pascal Style Guide

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 the 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.”

This document does not refer to or explain the language syntax and grammar. 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.

Next

General Rules: Identifiers, Keywords, Indentation