| | 1 | == Coding Conventions == |
| | 2 | |
| | 3 | === Naming Convention === |
| | 4 | |
| | 5 | The following conventions are applied to names within these namespaces: |
| | 6 | |
| | 7 | * 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) |
| | 8 | * Class methods start with a lowercase character, e.g. load(), store(), giveMoney() |
| | 9 | * Public attributes of a class start with an uppercase, e.g. Layer, Set, ResourceType |
| | 10 | * Private and Protected attributes of a class start with an underscore character, then an uppercase letter, e.g. _State, _ResourceKind |
| | 11 | * Local variables and parameters start with a lowercase letter, e.g. size, x, i |
| | 12 | * Structures and Classes start with the uppercase C letter, then the name starting with an uppercase letter as well, e.g. CTexture, CMyClass |
| | 13 | * Interfaces start with the uppercase I letter, then the name starting with an uppercase letter as well |
| | 14 | * Iterators start with the prefix 'It' (uppercase I, lowercase t), then the name starting with an uppercase letter, e.g. [ItTexture |
| | 15 | * Other types, enums and the like are prefixed with an uppercase T, then the name. |
| | 16 | * Globals function and values are prefixed by their namespace values, then follow the standard conventions, e.g. NLMISC::createAttribut() |
| | 17 | * 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 |
| | 18 | |
| | 19 | Note that there is no difference between variables and constants. |