-
Notifications
You must be signed in to change notification settings - Fork 0
Coding conventions
vhirtham edited this page Jul 10, 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 which don't occur in the list at the end of this site. Only use them if it is totally clear what they mean.
- Class names always start with a capital letter
- Start with a capital letter
- 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
Here is a list of commonly used abbreviations used in the code. Try to stick to this scheme. Only use abbreviation which are not listed here, if their meaning is obvious. If a common abbreviation is missing, feel free to add it.
-
num
: meaning: "number of" - example:numAllocations
-
ptr
: meaning: "pointer" - example:currentDataPtr