-
Notifications
You must be signed in to change notification settings - Fork 11
Coding Style Guidelines
Darren Shen edited this page Nov 22, 2015
·
2 revisions
This document contains some guidelines to contributing code to Stateline. By default, follow this guideline. For anything not covered in this guideline, refer to the C++ Core Guidelines.
- Does it really need to be a class/have internal state?
- Do you really need inheritance in this circumstance? (probably not, unless you've got a container of the parent type full of different child types).
- Use
#pragma once
for header guards.
- Braces on a newline.
- 2 space indent.
- Use Doxygen for documenting functions and classes.
- Use
//
style comments. - Document files, classes, functions and methods using Doxygen C++ style.
- Add the copyright licence header to every source and header file.
- Comment with proper capitalisation and punctuation.
- camelCase for variables and functions with lower case beginning
- PascalCase for classes.
- SCREAMING_CAPS_FOR_CONSTANTS
-
underscore_
notation for private member variables. -
.hpp
for headers,.cpp
for source files - Australian english spelling of all variables (e.g. marginalise not marginalize).
- Use logging over iostream
- Use iostream over stdio