Naming variables
Scope: managed applications, mobile applications, and ordinary applications.
1. To name a variable, use conventional terms related to the respective subject area so that the variable's name would be descriptive and convey its purpose to the reader.
2. Variable names must not contain spaces, even when it is composed of a few words. Each word in a variable name starts with a capital letter, including single-letter prepositions and pronouns.
Example:
Var DirectoryActionsDialogBox; // A dialog box to manage directories.
VarItemsInBox; // The number of items in a box.
Incorrect:
arrayofattributes, respKindName, newStr
3. Variable names must not start with an underscore.
4. Variable names must contain more than one character, except for loop counters. It is allowed to assign loop counters with single-character names.
5. Name Boolean variables so that the name would convey the true state of the variable.
Example:
Var HasErrors; // Indicates whether the procedure contains errors.
Var IsPackageItem; // Indicates whether the item is a package.
See also: