-
Notifications
You must be signed in to change notification settings - Fork 0
Coding conventions
vhirtham edited this page Dec 5, 2018
·
7 revisions
- name should make the purpose of the variable/class (instance) obvious
- if the name consists of multiple words, each new word starts with a capital letter
- don't use underscores inside the name. Don't write something like
my_varible
. It should bemyVariable
- Avoid abbreviations. Only use them if it is totally clear what they mean.
- Class names always start with a capital letter
- Start with a capital letter (exceptions: if the class needs to match a certain template interface, for example the allocators or the spinlock which should be used with STL locks)
- Return type should be (generally) derivable from the functions name. For example
IsValid
orHasNewData
implies a bool as return value andGetNumTriangeles
an integer type
- always start with a small letter
- class member variables get the prefix "m" (
mMyMemberVariable
)
- Start with an underscore
- The name starts with a small letter
- Follow the general naming conventions
- example:
_templateParameter
- If you use using or typedef the naming of the alias type follows the Class naming conventions