gitmyhub

CppCoreGuidelines

CSS ★ 45k updated 24d ago

The C++ Core Guidelines are a set of tried-and-true guidelines, rules, and best practices about coding in C++

The C++ Core Guidelines are an authoritative, community-maintained set of best practices for writing safe, modern C++ code, created by the language's inventor to help teams avoid common and costly mistakes.

C++Markdownsetup: easycomplexity 1/5

The C++ Core Guidelines is a document — not executable code — that contains a large collection of best practices, rules, and recommendations for writing C++ programs correctly and safely. C++ is a powerful but notoriously complex programming language where it is easy to accidentally write code that corrupts memory, leaks resources, or behaves unpredictably. The guidelines address these dangers by describing patterns and techniques from modern C++ (C++11 and newer) that help programmers avoid the most common and costly mistakes.

The document was created and is maintained by Bjarne Stroustrup, who designed the C++ language itself, along with a large community of C++ experts from multiple organizations. It covers high-level topics such as how to design interfaces, how to manage memory and other resources without leaks, how to write safe concurrent code (code that runs multiple things at once), and how to think about object-oriented and generic programming in C++. Each guideline explains not just what to do but why, with examples of problematic code and the preferred alternative. The rules are designed so that automated analysis tools can check a codebase against them, flagging violations with references to the relevant guideline.

You would read the C++ Core Guidelines when learning modern C++, when working to improve the safety and correctness of an existing C++ codebase, or when establishing coding standards for a team. It is especially valuable for developers coming from other languages or older C++ styles (pre-C++11) who want to understand how the language is meant to be used today. The repository itself is a Markdown document; the primary language listed (CSS) refers to the styling of the hosted web version, not a programming language.

Where it fits