Update of coding guidelines for cpp #1250
Labels
C++
discussion
priority: medium
Should be solved within half a year
workload: medium
Would take a week or less
Currently, our coding guidelines only describe function and class/struct naming conventions and we need to adapt these to all other cpp types like template parameters and member functions.
I propose the following conventions, which are also used in Boost and the STL. These would mean minimal changes to our code and the snake_case would allow our spell checker work properly. CamelCase and pascalCase often do not work with spell checkers.
t8_snake_case
witht8
prefix (t8_forest_...
,t8_geometry_...
)t8
prefix (thet8
prefix is already in the class name)TCamelCase
with leadingT
for templateFurthermore, we should think about the
_t
in our typedefs, since it is reserved for POSIX.Alternatively, we could also completely remove the
t8
prefixes and introduce namespaces, but this would be a bigger change.The longer we wait, the more we have to change.
Edit:
I stmbled upon some functions, which do this:
returnType t8_some_function(void);
From my short research this is the way to go, but we do not do this consistently. Should we adapt it to all other functions which have no arguments?The text was updated successfully, but these errors were encountered: