[Home][What's New][About][How To][Q&A Forum][Tutorials][Standards][Articles][Links][Contact Page][Mail Us][Guest Book][Join][Copyright][Privacy Statement][Disclaimer][DigitalSA]



Google
Naming Standards: General

Whether you are naming variables, forms, controls or tables, there are certain guidelines to follow when thinking up a name for the item in question. Now we are not talking about prefixes or suffixes, scope and data type, we are talking about the actual name part, the "body" of the name.
  1. Always use "Option Explicit" as the first line of ALL your code modules. To have VB insert this line automatically for you, go to the "Tools" menu, select "Options", and then select the "Editor" tab on the form that pops up. Make sure that the "Require Variable Declaration" checkbox is checked.

  2. Names must be descriptive. E.g. "Number" does not give enough information, "CustomerNumber" does. Creating a variable called "X", "i" or something similar is just laughably stupid, and in some countries it's a capital offense.

  3. Names must be concise, i.e. "FirstInitialCustomerFinancialTransactionRecordNumber" is as bad as "X".

  4. Don't use abbreviations, i.e. use "CustomerCode" as opposed to "CustCode"

  5. Use capitalization to "separate" words, e.g. use "FileCodeCount" as opposed to "filecodecount" or "FILECODECOUNT".

  6. Don't use underscores. "CustomerCode" is better than "Customer_Code"

  7. Always use exactly the same name for the same item, e.g. a variable called "CustomerCode" will be displayed in a text box called txtCustomerCode. The label above the text box will be named lblCustomerCode. Not CustomerNumber, or Customer, or Code or anything else. If it's CustomerCode in one place, it must be CustomerCode everywhere.
Back to Standards Page

[Home][What's New][About][How To][Q&A Forum][Tutorials][Standards][Articles][Links][Contact Page][Mail Us][Guest Book][Join][Copyright][Privacy Statement][Disclaimer][DigitalSA]


Shrog mailing list. Enter email address:

© Copyright 2000 by Robert Terblanche (Robert@Shrog.iwarp.com). All rights reserved. For more info see our Copyright Statement.

All information on this site is used at your own risk. For more details see our Disclaimer Statement.



Beta