Augustus Coding Style Guide - Gaius-Augustus/Augustus GitHub Wiki
Welcome to the page of our Coding Style Guidelines!
Our Coding Style Guidelines are oriented to the Guidelines of Google and Gnu GCC. If you are unsure how to code and your problem is not explicitly mentioned in this guide, please have a look at
https://gcc.gnu.org/codingconventions.html
or
https://google.github.io/styleguide/cppguide.html
Thank you!
PS: We know, that in the existing code, a lot of files are not following our guidelines. Please feel free to correct this and of course, don't follow the bad examples!
Documentation
For Documentation Style Guide please look up our Documentation Style Guidelines!
Thank you!
Braces
Please open your curly braces in the same line as the name of the function like
if (hours < 24 && minutes < 60 && seconds < 60) {
return true;
}
else {
return false;
}
Header Files
In general, every .cc file should have an associated .hh file (not a .h file, this has historical reasons and should stay constant). There are some common exceptions, such as unit tests and small .cc files containing just a main() function. Correct use of header files can make a huge difference to the readability, size, and performance of your code.
Variable Definitions
Variables should be defined at the top of the functions or methods, not at the first use. This is just about the readability. Please don't define variables in between!
Tab Width
Please use four spaces for a tab. Please don't use normal tabs! Most editors are able to do this for you. Gedit does this by default.