explaingit

cpp-best-practices/cppbestpractices

8,735Audience · developerComplexity · 1/5Setup · easy

TLDR

A community-written reference guide covering agreed-upon best practices for writing correct, readable, and maintainable C++ code, spanning style, tooling, testing, safety, and build choices.

Mindmap

mindmap
  root((C++ Best Practices))
    What it is
      Community written guide
      Markdown reference files
      No code to install
    Topics
      Code style
      Tooling and analysis
      Testing practices
      Build systems
    Author
      Jason Turner
      YouTube and book companion
    Audience
      C++ developers
      Teams setting standards
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Review community-vetted guidance on C++ code style, tooling, and build practices before starting a new project.

USE CASE 2

Use as a reference when making decisions about testing frameworks, static analysis tools, or compiler flags in a C++ codebase.

USE CASE 3

Share with a team as a foundation for agreeing on coding standards and code review criteria.

USE CASE 4

Learn from experienced C++ practitioners which patterns to avoid and which idioms are considered safe.

Tech stack

C++CMake

Getting it running

Difficulty · easy Time to first run · 5min
No license information is mentioned in the explanation.

In plain English

This repository is a collaboratively written guide to best practices for C++ programming. C++ is a widely used systems programming language that gives developers a lot of control but also a lot of rope to make mistakes. This guide aims to collect agreed-upon advice for writing C++ code that is correct, readable, and maintainable. The project was started and is maintained by Jason Turner, who also produces a related book, a YouTube channel focused on C++ topics, a starter project template for C++ and CMake, and an O'Reilly video course. The GitHub repository is the community-editable home of the written guide, which lives as a series of Markdown files in the repository. A preface document describes the project's goals and approach in more detail. The README itself is brief and mostly points to external companion resources rather than summarizing the content of the guide. The actual advice and recommendations are spread across linked files within the repository rather than in the README. Based on the project description, the guide is structured as a reference for C++ developers of varying experience levels, covering topics like code style, tooling choices, testing, safety, and build practices. This is a reference document rather than software you install or run. If you are learning C++ or working on a C++ codebase and want community-reviewed guidance on how to approach common decisions, this guide is the kind of resource you would read through and return to as questions come up.

Copy-paste prompts

Prompt 1
Based on cpp-best-practices/cppbestpractices, what are the recommended tools for static analysis and linting in a modern C++ project?
Prompt 2
I'm setting up a new C++ project with CMake. According to cppbestpractices, what are the most important build and compiler settings I should configure from the start?
Prompt 3
What does the C++ best practices guide recommend for error handling, exceptions versus error codes versus std::expected?
Prompt 4
Summarize the key testing recommendations from cpp-best-practices/cppbestpractices and suggest which test framework to use for a small C++ library.
Open on GitHub → Explain another repo

← cpp-best-practices on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.