Best practices
Habits experienced C++ teams agree on.
Follow the C++ Core Guidelines
Maintained by Bjarne Stroustrup and Herb Sutter; tools like clang-tidy can check many of the rules.
Rule of zero
Let members (vector, unique_ptr, string) manage resources so your class needs no custom destructor, copy or move.
Const correctness
Mark methods and references const wherever possible; it documents intent and enables optimisation.
Turn on warnings and sanitizers
Build with -Wall -Wextra -Werror in CI and run tests under AddressSanitizer and UndefinedBehaviorSanitizer.
Use a package manager
vcpkg or Conan with CMake gives reproducible dependency builds instead of vendored copies.
Saved in this browser only. Part of Clean code foundations (0/5).