Code style
Last updated: 2021-08-16
A consistent code style is important for everyone. Pull requests are only accepted if they follow our code style. But don't worry, it's not that difficult. The main points are:
- Reformat your code with
clang-format. There is a.clang-formatfile in the repository root. - Function and method names are in
camelCase - Class and struct names are in
PascalCase - Namespaces, files and directories are named in
snake_case - Headers have the extension
.hand C++ source files are named.cpp - Macros and constants are in
SCREAMING_SNAKE_CASEand macros are prefixed withBRICKSIM_ - Typedefs are
snake_case_t(with_tpostfix) - No
using namespacein headers and nousing namespace stdin.cppfiles - When there is no explicit rule for something, ask or adapt to the existing code