Skip to content

guidelines

r4d2 edited this page Jan 10, 2014 · 17 revisions

C++ Programming Guidelines

We base our style and best practice guidelines on the ones at geosoft.no with a few modifications.

Style guideline additions:

  1. Don't use the underscore _ suffix for private members.
  2. We use the Id suffix instead of the No suffix.
  3. We use the file extensions .cpp and .hpp.
  4. In some cases it might be permitted to define methods in the header files (e.g. when templating)
  5. break and continue are permitted.
  6. Use nullptr for Null-Pointers instead of 0 or NULL
  7. For the else block, either put opening and closing bracket on the same line or both on separate lines.
        // DO:
        if ( ) {
          // do something
        } else {
          // do something else
        }

Clone this wiki locally