Skip to content

About this site

This site teaches low-level design with C++: how to start from an ambiguous problem statement, ask clarification questions, write down requirements, model the domain, choose a design, and implement and test it in modern C++. It also explains when a design choice does not fit, because every pattern and principle has costs.

It is written for developers who know basic programming and want to move from “code that works” to designs that are justified, testable, and easy to change. Later sections cover advanced topics such as concurrency, generic programming, and API compatibility.

The site is under construction. Pages are published section by section, and the sidebar only lists pages that exist.

Every lesson shows, under its title:

  • Difficulty: Beginner, Intermediate, or Advanced, shown as text and a marker (●○○, ●●○, ●●●).
  • Prerequisites: lessons to read first, with links.
  • Key concepts: the main ideas the lesson covers. These are also used by search.

You can mark a lesson as read or bookmark it. See My progress and bookmarks for how that information is stored.

Examples use C++20 and are compiled with GCC 11.4 and Clang 14 using -Wall -Wextra -Wpedantic -Werror. Features from later standards (for example std::expected or std::print) are mentioned only in clearly labeled notes and are not used in verified examples. Tests use a small assertion header written for this site, so the examples have no third-party dependencies.

Every code block on the site carries one of these labels. The labels for code taken from the example sources are computed from the recorded validation run; they are never typed by hand.

Label Meaning
Verified Compiled with GCC and Clang, and its tests and output comparison passed in the recorded run.
Compiled Compiles with both compilers, but its output is not tested.
Illustrative A fragment to explain an idea. It is not compiled on its own.
Flawed (intentional) Shows a mistake on purpose. It is always followed by a corrected version.
Not validated No passing validation run is recorded yet. Treat the code with care.

For example, this class comes from a small example program used to test the validation pipeline. Its label and details are generated from the latest validation report:

VerifiedCompiled and tested with GNU 11.4.0 and Clang 14.0.0 (C++20, 2026-12-01).

reading_list.hpp
// A list of book titles to read, in the order they were added.
// Invariant: titles are non-empty and unique. Every function below keeps
// that rule true, so code using a ReadingList never has to check it.
class ReadingList {
public:
// Adds a title to the end of the list. Returns false (and changes
// nothing) if the title is empty or already present, true if added.
// `const std::string&` passes the caller's string by reference, so it
// is not copied on the way in, and `const` promises add will not change
// it. push_back makes the one copy the list keeps. A string literal,
// as in add("Design Patterns"), is first turned into a temporary
// std::string for the reference to refer to.
bool add(const std::string& title);
// True if the title is in the list. The `const` after the brackets
// promises that asking does not change the list.
[[nodiscard]] bool contains(const std::string& title) const;
// How many titles there are. noexcept: it cannot throw.
[[nodiscard]] std::size_t size() const noexcept { return titles_.size(); }
// Read-only access to every title, without copying them. The reference
// is valid as long as the list exists, and shows later changes; a
// reference or iterator to one title may be invalidated by the next add.
[[nodiscard]] const std::vector<std::string>& titles() const noexcept { return titles_; }
private:
// The titles themselves, owned by the list. Private, so the only way
// to add one is through add, which checks the invariant.
std::vector<std::string> titles_;
};

A hand-written fragment, by contrast, is labeled as illustrative:

IllustrativeA fragment for explanation; not compiled on its own.

auto list = ReadingList{};
list.add("Design Patterns"); // returns true the first time
How example code gets its validation label
Text description of the diagram

The example’s source files are built with CMake using both GCC and Clang. CTest then runs the example’s unit tests and compares the program’s output with its recorded expected output. The results of that run are written to a validation report file. Separately, the snippet shown in the article is extracted directly from the same source files. The label shown above the code combines the two: it is “Verified” only if the report shows that all of the example’s tests passed under both compilers.

Diagram source (Mermaid)
flowchart LR
source["Example source files"] --> build["CMake build with GCC and Clang"]
build --> tests["CTest: unit tests and output comparison"]
tests --> report["validation-report.json"]
report --> label["Label shown above the code"]
source --> snippet["Snippet region extracted"]
snippet --> label

Each page records in its metadata the sources that were actually consulted, or a note saying that none were. The site does not invent references, quotations, benchmark numbers, or program output. Output shown with an example comes from the same expected-output file that the tests compare against. Statements about performance are qualitative unless a measurement was run and its environment recorded.

The site has no accounts, analytics, or server. Read marks and bookmarks stay in your browser’s local storage and can be removed at any time from My progress and bookmarks.

  • The curriculum is being written; most sections are not published yet.
  • Technical review status is tracked per page. Until a page is reviewed, it may contain mistakes.
  • Accessibility is checked for keyboard access, visible focus, colour contrast, and text alternatives for diagrams. The site does not claim formal conformance with any accessibility standard.
  • Search is built from the published pages only and runs in your browser.