Abstract:This article documents a standard style for formatting Delphi code. It is based on the conventions developed by the Delphi team.
Object Pascal Style Guide
This article documents a standard style for formatting Delphi code. It is based on the conventions developed by the Delphi team.
We take it for granted that many well established shops will have conventions different than those specified here. As a result, we strongly recommend using a tool that can convert your code into Borland style before submitting it to Borland, Project JEDI, or any other public source repository. We don''''t want to force you to change your conventions, but we insist that all code that ships with Borland products follows these conventions. We strongly encourage you to follow these conventions when submitting code into any form of public repository.
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.
It goes without saying that these are conventions based primarily on matters of taste. Though we believe in, and admire the style promoted in these pages, we support them not necessarily because we believe they are right and others are wrong, but because we believe in the efficacy of having a standard which most developers follow. The human mind adapts to standards, and finds ways to quickly recognize familiar patterns, thereby assimilating meaning quickly and effortlessly. It is the desire to create a standard that will make reading code as simple as possible for the largest number of people that is behind this effort. If at first our guidelines seem strange to you, we ask you to try them for awhile, and then we are sure you will grow used to them over time. Or, if you prefer, keep your code in your own format, and run it through a program that follows our guidelines before submitting it to Borland or to a public repository.
Some text editors, such as Visual SlickEdit can help you format your code according to a particular style. Readers who are aware of other tools that provide this same service should write me at that address provided at the end of this section.
One free formatter developed by Egbert van Nes is available at the following URL:
http://www.slm.wau.nl/wkao/delforexp.html.
A commercial option is CrackerJax for Delphi:
http://www.kineticsoftware.com/html/products.html.
Before closing this introduction, I want to reiterate that on the Borland web site, and on the CDs that we ship with our product, these standards are the law. We want to present our code in a unified and easy to read style, and enforcing the rules in this guide is the simplest way to achieve that end.
Do not post this specification on other web sites. Instead, simply link to this version of the document.
We accept feedback in the form of corrections or suggestions. Send your communications to Charlie Calvert .
Contents
- 1.0 Introduction
- 1.1 Background
- 1.2 Acknowledgments
- 2.0 Source Files
- 2.1 Source-File Naming
- 2.2 Source-File Organization
- 2.2.1 Copyright/ID block comment
- 2.2.2 unit declaration
- 2.2.3 uses declarations
- 2.2.4 class/interface declarations
- 3.0 Naming Conventions
- 3.1 Unit Naming
- 3.2 Class/Interface Naming
- 3.3 Field Naming
- 3.4 Method Naming
- 3.5 Local Variable Naming
- 3.6 Reserved Words
- 3.7 Type Declarations
- 4.0 White Space Usage
- 4.1 Blank Lines
- 4.2 Blank Spaces
- 4.2.1 A single blank space (not tab) should be used:
- 4.2.2 Blanks should not be used:
- 4.3 Indentation
- 4.4 Continuation Lines
- 5.0 Comments
- 5.1 Block Comments
- 5.2 Single-Line Comments
- 6.0 Classes
- 6.1 Class Body Organization
- 6.2 Method Declarations
- 6.3 Data Store Declarations
- 7.0 Interfaces
- 7.1 Interface Body Organization
- 8.0 Statements
- 8.1 Simple Statements
- 8.1.1 Assignment and expression statements
- 8.1.2 Local variable declarations
- 8.1.3 Array declarations
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!
相关文章- Nearest Neighbor、Bilinear、Bi
- 自动升级程序精简版 (支持断点下
- 项目迭代开发手记--文件分割存储
- 计算PI值到一亿位的算法
- Delphi程序制作要点
- 将某一主机域名解析为IP地址。
- 制造业工装信息管理系统 (ADO AC
- 组件制作之五(托盘组件)
- // I have a comment ----Delphi
- GSM规范中的部分编码转换
热点关注- AnsiString?PChar?赋值
- Report Machine 3.0 (报表
- MapX v5.02.25 破解文件
- WDBOX v1.0 多选下拉列表
- 用Delphi开发视频聊天软件
- Delphi客户服务器应用开发
- AES 加密算法函数包及演示
- ACCESS/SQL 数据库存取图
- 熊猫烧香核心源码(Delphi
- 把整个网页保存成JPG图片(
- 高级计算器 V1.0 (含代码)
- Delphi版模仿熊猫烧香病毒
- 精确定位打印程序 (含源代
- Delphi文件管理(六)
- 将数字四舍五入保留两位小
- 绝地程序编辑器 v1.0.1.4
- 关于自定义界面的方案(Eas
- Delphi 对象链接与嵌入(
- 用HTML页面做程序界面演示
- Delphi模拟最小化恢复关闭
- 用Delphi实现24位真彩色图
- 限制客户机运行程序 (有关
- Delphi中用API实现在MSN的
- DELPHI数据库应用程序的开
- Delphi 动态链接库编程(
- QQ号码自动申请器及源代码
- Win9x 下调整系统时钟控件
- delphi中的XML解析控件TXM
- 几个游戏内存修改器代码
- TT8 DevExpress 最新系列
- Tnt Delphi Unicode Contr
- DelphiTwain 2004-1-20 (
- Delphi中数据的自动录入
- 经验技巧:分享两条Delphi
- Delphi中Hash表的使用方法
IDC资讯 虚拟主机 域名注册 托管租用 vps主机 智能建站
网站运营 建站经验 策划盈利 搜索优化 网站推广 免费资源
网站联盟 联盟新闻 联盟介绍 联盟点评 网赚技巧
行业资讯 业界动态 搜索引擎 网络游戏 门户动态 电子商务 广告传媒
网络编程 Asp.Net编程 Asp编程 Php编程 Xml编程 Access Mssql Mysql 其它
服务器技术 Web服务器 Ftp服务器 Mail服务器 Dns服务器 安全防护
软件技巧 其它软件 Word Excel Powerpoint Ghost Vista QQ空间 QQ FlashGet 迅雷 Internet Explorer
网页制作 FrontPages Dreamweaver Javascript css photoshop fireworks Flash
程序设计 Java技术 C/C++ VB delphi
网络知识 网络协议 网络安全 网络管理 组网方案 Cisco技术
操作系统 Win2000 WinXP Win2003 Mac OS Linux FreeBSD
- 8.1 Simple Statements




