Skip to content
aviral gupta

// LEARN · LANGUAGES & FRAMEWORKS

C++

A practical modern C++ course from a first compiled program to ownership, move semantics, templates, concurrency and performance. Every example is compiled and run as C++23 with sanitizers switched on.

Level: Beginner to advanced · For: Anyone who wants to write safe, current C++, from a first program to systems code. Prior programming helps but is not required.

Syllabus

Beginner

Coming soon

After this level you can

  • Compile and run a single-file C++23 program with warnings and sanitizers switched on, and read the first error the compiler reports
  • Write programs with fundamental types, if and switch, loops and functions that take parameters by value or by const reference
  • Store and process data with std::string, std::vector, std::array, std::map and std::unordered_map
  • Define a class whose constructor enforces an invariant and whose destructor releases what the object owns
  1. B1Toolchain and first programsComing soon · 5 lessonsRuns on your computer

    Compile, run and fix a small program with -Wall -Wextra and sanitizers

    You build: A unit converter

    1. B1.1Coming soon
    2. B1.2Coming soon
    3. B1.3Coming soon
    4. B1.4Coming soon
    5. B1.5Coming soon
  2. B2Types, variables and control flowComing soon · 5 lessonsRuns on your computer

    Use fundamental types, brace initialisation, if, switch and loops correctly

    You build: A number-guessing game with <random>

    1. B2.1Coming soon
    2. B2.2Coming soon
    3. B2.3Coming soon
    4. B2.4Coming soon
    5. B2.5Coming soon
  3. B3Functions, references and namespacesComing soon · 5 lessonsRuns on your computer

    Split logic into functions with the right parameter passing, across header and source files

    You build: A small maths library in a header and source file

    1. B3.1Coming soon
    2. B3.2Coming soon
    3. B3.3Coming soon
    4. B3.4Coming soon
    5. B3.5Coming soon
  4. B4Strings and standard containersComing soon · 6 lessonsRuns on your computer

    Store and process text and collections with the standard library

    You build: A word-frequency counter

    1. B4.1Coming soon
    2. B4.2Coming soon
    3. B4.3Coming soon
    4. B4.4Coming soon
    5. B4.5Coming soon
    6. B4.6Coming soon
  5. B5Classes and invariantsComing soon · 5 lessonsRuns on your computer

    Write a class whose constructor enforces an invariant and whose destructor cleans up

    You build: A bank-account class

    1. B5.1Coming soon
    2. B5.2Coming soon
    3. B5.3Coming soon
    4. B5.4Coming soon
    5. B5.5Coming soon

Beginner project

Contact book CLI

Reads add, list, find, delete, save and load commands, keeps contacts in a vector of structs, saves them to a text file and runs sanitizer-clean.

Runs on your computerSelf-checked against a rubric

Intermediate

Coming soon

After this level you can

  • Choose between a local object, std::unique_ptr and std::shared_ptr for an ownership need, and spot a dangling reference
  • Implement a resource-owning type that follows the rule of zero or the rule of five, and explain when a move happens
  • Report errors with exceptions, std::optional or std::expected, and give each function a stated exception-safety guarantee
  • Process data with algorithms, lambdas and range views, and write function templates constrained by concepts
  • Split a program into a CMake project with CTest tests and debug it with GDB
  1. I1Memory, lifetime and smart pointersComing soon · 6 lessonsRuns on your computer

    Choose the right owner and catch lifetime bugs with AddressSanitizer

    You build: A tree of nodes owned by unique_ptr

    1. I1.1Coming soon
    2. I1.2Coming soon
    3. I1.3Coming soon
    4. I1.4Coming soon
    5. I1.5Coming soon
    6. I1.6Coming soon
  2. I2Copy, move and value semanticsComing soon · 5 lessonsRuns on your computer

    Implement rule-of-zero and rule-of-five types and predict copies versus moves

    You build: A Buffer type with tests

    1. I2.1Coming soon
    2. I2.2Coming soon
    3. I2.3Coming soon
    4. I2.4Coming soon
    5. I2.5Coming soon
  3. I3Error handlingComing soon · 5 lessonsRuns on your computer

    Pick exceptions, std::optional or std::expected for a failure and state the guarantee

    You build: A config-file parser

    1. I3.1Coming soon
    2. I3.2Coming soon
    3. I3.3Coming soon
    4. I3.4Coming soon
    5. I3.5Coming soon
  4. I4Algorithms, lambdas and rangesComing soon · 6 lessonsRuns on your computer

    Replace hand-written loops with algorithms and range views

    You build: A CSV sales report

    1. I4.1Coming soon
    2. I4.2Coming soon
    3. I4.3Coming soon
    4. I4.4Coming soon
    5. I4.5Coming soon
    6. I4.6Coming soon
  5. I5Generic programmingComing soon · 5 lessonsRuns on your computer

    Write templates constrained by concepts, and compile-time code with constexpr

    You build: A generic statistics header

    1. I5.1Coming soon
    2. I5.2Coming soon
    3. I5.3Coming soon
    4. I5.4Coming soon
    5. I5.5Coming soon
  6. I6Files, projects, testing and debuggingComing soon · 5 lessonsRuns on your computer

    Organise a multi-file CMake project with CTest tests and step through it in GDB

    You build: A log-file analyser

    1. I6.1Coming soon
    2. I6.2Coming soon
    3. I6.3Coming soon
    4. I6.4Coming soon
    5. I6.5Coming soon

Intermediate project

Log analyser

A CMake project that parses every log file in a directory with std::expected and reports per-level counts and the top messages using ranges.

Runs on your computerSelf-checked against a rubric

Advanced

Coming soon

After this level you can

  • Design polymorphic code with virtual interfaces, std::variant or templates, and justify the choice
  • Write concurrent code with std::jthread, mutexes, condition variables and atomics that ThreadSanitizer reports clean
  • Measure and improve performance with optimisation flags, data layout and avoided copies, with before-and-after numbers
  • Find and fix bounds, lifetime and integer-overflow bugs, and harden a build with sanitizers and library assertions
  1. A1Polymorphism and designComing soon · 5 lessonsRuns on your computer

    Choose between virtual interfaces, std::variant and templates for a design

    You build: A pluggable shape renderer

    1. A1.1Coming soon
    2. A1.2Coming soon
    3. A1.3Coming soon
    4. A1.4Coming soon
    5. A1.5Coming soon
  2. A2ConcurrencyComing soon · 6 lessonsRuns on your computer

    Write threaded code that ThreadSanitizer reports clean

    You build: A parallel word counter

    1. A2.1Coming soon
    2. A2.2Coming soon
    3. A2.3Coming soon
    4. A2.4Coming soon
    5. A2.5Coming soon
    6. A2.6Coming soon
  3. A3PerformanceComing soon · 5 lessonsRuns on your computer

    Measure, then speed up code with flags, data layout and fewer copies

    You build: Optimising a slow report, with before and after timings

    1. A3.1Coming soon
    2. A3.2Coming soon
    3. A3.3Coming soon
    4. A3.4Coming soon
    5. A3.5Coming soon
  4. A4Safety and security pitfallsComing soon · 5 lessonsRuns on your computer

    Find and fix bounds, lifetime and overflow bugs, and harden a build

    You build: Fixing a vulnerable parser

    1. A4.1Coming soon
    2. A4.2Coming soon
    3. A4.3Coming soon
    4. A4.4Coming soon
    5. A4.5Coming soon
  5. A5Modern features and the ecosystemComing soon · 5 lessonsRuns on your computer

    Use custom formatters, coroutine generators and modules, and add a dependency with CMake

    You build: A formatted report with a generator pipeline

    1. A5.1Coming soon
    2. A5.2Coming soon
    3. A5.3Coming soon
    4. A5.4Coming soon
    5. A5.5Coming soon

Advanced project

Thread-safe key-value store

An in-memory store with a SET, GET, DEL and STATS line protocol driven by worker threads, sanitizer-clean and benchmarked before and after one optimisation.

Runs on your computerSelf-checked against a rubric

Capstone

Capstone

File indexer and search tool

Walks a directory tree, builds an inverted index in parallel with a thread pool, saves it to a binary file and answers AND and OR queries.

Runs on your computerSelf-checked against a rubric