What Delphi coding standards document(s) do you follow?
Our company is looking at putting some better coding standards in place, to improve our code’s readability, reviewability, and maintainability. We’ve come across CodeGear’s “Object Pascal Style Guide”, but it hasn’t been touched in quite a while and I imagine a number of people have made some local improvements or additions. I’ve come across some published variations and other documents, which I will list, below.
NB: I do not want to start a style war. I just want to know what standards you follow, and why.
Thanks.
UPDATE: Well, the "JCL Delphi Language Style Guide" seems to be the clear winner! Thanks!
JCL Delphi Language Style Guide
(An extension of CodeGear’s “Object Pascal Style Guide”)
http://jcl.delphi-jedi.org/documents/styleguide.html
(Thanks, Jeroen Pluimers, for noticing that the original borland.com link had died and for providing the new link.)
For some inane historical reason, the coding standard at my work is to have all keywords in uppercase, in both delphi and sql. Thank god for caps lock.
CodeGear’s “Object Pascal Style Guide”
http://edn.embarcadero.com/article/10280
About.com’s “Delphi Identifier Naming Conventions”
http://delphi.about.com/od/standards/l/bldnc.htm (via Wayback Machine)
There can be a tendency to over-engineer coding standards to the point where they get in the way of writing code.
I agree with Jozz’s comment. You can look at all the recommended standards, pick one and force it upon your coders or you can get your team involved in the process.
In my experience, the best way to get a team engaged is to have the team come up with the idea and the benefits of adoption. Your existing talent is your best resource. Likewise, they can be your ultimate enemy if you force them down a path they don’t buy into.
So, take a look at your existing coding variants and get the team together for some vibrant discussions on:
The most important objective must be to establish a ‘standard’ that best serves your team and your company.
JVCL-extended version of CodeGear’s “Object Pascal Style Guide”
(This looks just like the JCL version, to me.)
http://jvcl.delphi-jedi.org/StyleGuide.htm
(Thanks go to Jeroen Pluimers, for providing the new link.)