Write in ISO Standard C++
Where there is a choice, prefer default arguments over overloading
Don’t define a default constructor that only initializes data members; use member initializers inste
Avoid trivial getters and setters
Declare one name (only) per declaration
Don’t insist to have only a single return-statement in a function
Encapsulate messy constructs, rather than spreading through the code
Keep the number of function arguments low
If you want a cross-compiler ABI, use a C-style subset
Define and initialize member variables in the order of member declaration
Minimize explicit sharing of writable data
Use template metaprogramming only when you really need to
Never transfer ownership by a raw pointer (T*) or reference (T&)
Rely on constructors and assignment operators, not memset and memcpy
Avoid error handling based on global state (e.g. errno)
Don’t write using namespace at global scope in a header file
To return multiple “out” values, prefer returning a struct or tuple
Prefer enum classes over “plain” enums
Use constexpr for values that can be computed at compile time
Use templates to raise the level of abstraction of code
Specify concepts for all template arguments
Ideally, a program should be statically type safe
Prefer immutable data to mutable data
Encapsulate rule violations
Don't declare a variable until you have a value to initialize it with
Design to enable optimization
Use RAII to prevent leaks