-
Notifications
You must be signed in to change notification settings - Fork 25
Programming rules
BorjaFG edited this page Mar 4, 2019
·
6 revisions
We use the master
branch to release stable versions of the code. The develop
branch features code in development which must compile and pass all tests. Please, do not push your changes before running locally all unit tests and batch building for all the configurations.
- Braces go in a new line, unless the content is so small that it's not worth the extra line. In any case, if the opening brace is in the same line as the instruction (for, if...), the closing one should too be in the same line.
- Member variables are prefixed with "m_", and pointers are appended "m_p" or "p" (depending whether they are a class member variable or not).
- Class names start with a capital C and each word within the name is capitalized: CTimeLine, CGaussianNoise, ...
- Braces must be written in a new line, unless the content is so small that it's not worth the extra lines. In the case of properties, because they can have sometimes very little amount of code and a lot of braces, it is acceptable to make exceptions if readability is improved.
- Private variables not exposed to other classes are prefixed with "m_", whereas public variables are not.
- Classes, methods, properties and events' names must start with a capital letter and then first character from each word within the name is capitalized (e.g. HerdAgent, Shepherd, RunExperiment).
- Variable names start with a low-case letter and the first character from each word within is capitalized. A valid declaration would be: HerdAgent herdAgent, where the former is the name of the class and the latter is the name of the variable.