-
Notifications
You must be signed in to change notification settings - Fork 13
guidelines
We base our style and best practice guidelines on the ones at geosoft.no with a few modifications.
- Syle guidelines (Mirrors: pdf html)
- Best practice (Mirrors: pdf html)
- [Additional C++ programming guidelines](google style guide)
-
11. Don't use the underscore
_
suffix for private members. -
24. We use the
Id
suffix instead of theNo
suffix. -
34. We use the file extensions
.cpp
and.hpp
. -
36. In some cases it might be permitted to define methods in the header files (e.g. when templating)
-
58.
break
andcontinue
are permitted. -
70. Use
nullptr
for Null-Pointers instead of0
orNULL
-
72. Use form 2 only. // DO: if ( ) { // do something } else { // do something else }
-
83. Don't put the function return type on a separate line.
-
85. Don't put a space between the function name and the first
(
. DO:foo(bar)
, NOT:foo (bar)
. -
90. - 94. We use Doxygen style comments.
-
colon between class name and superclass list is surrounded by space. Elsewhere colon is suffixed with a space (label, switch cases) class A : B, C
-
throw declaration has the form throw (...)
-
constructor initializer list's colon should go on the next line if wrapping.
-
10. If no copy constructor and/or assignment operator is defined, disallow those operations by declaring but not defining a private copy constructor and assignment operator. This can be done with Google's
DISALLOW_COPY_AND_ASSIGN
macro. -
16. The
==
and!=
operators don't always need to be implemented .
Additionally to the practice guidelines from geosoft.no we use part of the Google C++ Style Guide:
- See our [Additional practice guidelines](google style guide)
- TO BE POSTED