Skip to content
Snippets Groups Projects

Styleguide

Guidelines

In general CBM follows the ALICE styleguide. It can be found here:

Exceptions

Note that we've adopted some exceptions to these rules:

Header files

Use #pragma once for header files instead of #define guards.

Reason: Less error prone and doesn't have to be altered when the file path changes. Potential drawbacks (issues with symlinks, compiler support) don't seem relevant for CbmRoot.

Naming

Function names

Function names should start with a capital letter. (Instead of lower case in ALICE)

Reason: Compatibility with old code.

Class members

Class members should be prefixed with f (instead of m in ALICE). (Struct members are never prefixed!)

Reason: No advantage in changing prefix. Stay compatible with existing code.

Formatting

Formatting differs in details from ALICE. Differences are caught with clang-format.