Does anyone know of any books, documents or other resources which
discuss variable naming conventions in Delphi, Pascal or Programming
Languages in General?
I briefly looked at Code Complete by Steve McConnell (?), but it
didn't seem to have much of what I wanted. Maybe I needed to look
closer. Is Code Complete a good book for this or are their others?
What types of naming conventions does the Delphi, Pascal or
Programming community at large use?
Thanks,
Dan Geiser <dge...@lansoft.com>
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
You can refer toMicrosoft's coding conventions normally used in Visual
Basic. You can also refer to various Delphi books and see the coding
convention followed. You will observe that the books use a convention where
the object type is added to the name and Microsoft does it the other way.
For exmaple, if you have a button called OK, then the way it is used by
Microsoft is
BtnOK.
Delphi books usually refer to it as OKButton.
If the place you are working for does a lot of coding using Microsoft and
other Windows based tools, the best way to name variables would be something
similar to the Microsoft way. A lot of companies code in this way. The OK
button would be named as:
ButtonOK
The Button would already be a part of the name with a number following it.
We delete the number and add an identifer to that.
dge...@lansoft.com wrote in article <8728717...@dejanews.com>...
>You can refer toMicrosoft's coding conventions normally used in Visual
>Basic. You can also refer to various Delphi books and see the coding
>convention followed. You will observe that the books use a convention where
>the object type is added to the name and Microsoft does it the other way.
>
>For exmaple, if you have a button called OK, then the way it is used by
>Microsoft is
>BtnOK.
>
>Delphi books usually refer to it as OKButton.
>
>If the place you are working for does a lot of coding using Microsoft and
>other Windows based tools, the best way to name variables would be something
>similar to the Microsoft way. A lot of companies code in this way. The OK
>button would be named as:
>ButtonOK
>
>The Button would already be a part of the name with a number following it.
>We delete the number and add an identifer to that.
One additional "advantage" to having the class type at the beginning
of the indentifier is that doing so groups all of the like components
together in the Object Inspector list box.
I've considered adding an underscore to "one off" components on the
form (i.e. the form itself, Notebook components, or other rarities) so
that these sort at the top of the list; I just don't much like the
LOOK of identifiers starting with underscores; anybody got any other
ideas?
Regards,
Stephen Posey
slp...@concentric.net