RidgeRun Developer Manual/Coding Styles/C++: Difference between revisions

Line 59: Line 59:


One single empty line is fine to separate logical blocks. Avoid multiple empty lines, commented empty lines, etc.
One single empty line is fine to separate logical blocks. Avoid multiple empty lines, commented empty lines, etc.
=== Variable naming standard ===
All variables names should follow the same standard. If the code is an extension of an existing framework/library, it should follow the existing standard. For example:
<syntaxhighlight lang="c">
int mixedCamelCaseVariable;
int CamelCaseVariable;
int snake_case_variable;
int horribleStandard_Variable;
</syntaxhighlight>
All new projects should use '''snake_case''' (all lower case with underscores between words).


=== Conditionals ===
=== Conditionals ===