What Delphi coding standards document(s) do you fo

2019-01-21 14:34发布

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!

9条回答
唯我独甜
2楼-- · 2019-01-21 14:58

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.)

查看更多
霸刀☆藐视天下
3楼-- · 2019-01-21 14:59

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.

时光不老,我们不散
4楼-- · 2019-01-21 15:01

CodeGear’s “Object Pascal Style Guide”

http://edn.embarcadero.com/article/10280

男人必须洒脱
5楼-- · 2019-01-21 15:01

About.com’s “Delphi Identifier Naming Conventions”

http://delphi.about.com/od/standards/l/bldnc.htm (via Wayback Machine)

成全新的幸福
6楼-- · 2019-01-21 15:05

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 reasons for adopting a coding standard.
  • Essential considerations in standardization.
  • Surfacing any insecurities in the team surrounding this issue.
  • Finding a point of agreement. What's important and what's not.
  • Establishing some corporate objectives so everyone feels like they are working towards a common goal.
  • Get the team to sell the benefits of standardization to themselves.

The most important objective must be to establish a ‘standard’ that best serves your team and your company.

查看更多
你好瞎i
7楼-- · 2019-01-21 15:18

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.)

查看更多
登录 后发表回答