Coding Conventions
Naming Convention
The following conventions are applied to names within these namespaces:
- All names must include one or more english words which have relevance to the entity being named. If multiple words are used for a more descriptive naming, all words begin with an uppercase letter, the underscore character is not used to separate words (e.g. Word, FullWord?, ComplexQualifiedWord?)
- Class methods start with a lowercase character, e.g. load(), store(), giveMoney()
- Public attributes of a class start with an uppercase, e.g. Layer, Set, ResourceType?
- Private and Protected attributes of a class start with an underscore character, then an uppercase letter, e.g. _State, _ResourceKind
- Local variables and parameters start with a lowercase letter, e.g. size, x, i
- Structures and Classes start with the uppercase C letter, then the name starting with an uppercase letter as well, e.g. CTexture, CMyClass
- Interfaces start with the uppercase I letter, then the name starting with an uppercase letter as well
- Iterators start with the prefix 'It' (uppercase I, lowercase t), then the name starting with an uppercase letter, e.g. [ItTexture?
- Other types, enums and the like are prefixed with an uppercase T, then the name.
- Globals function and values are prefixed by their namespace values, then follow the standard conventions, e.g. NLMISC::createAttribut()
- Preprocessor constants are in full uppercase, and consist of the namespace, an underscore character, then a name, with underscores as separators, e.g. NLNET_MACRO, NL_OS_UNIX
Note that there is no difference between variables and constants.
