Modern C++23 Learning Project - From First Principles to Mastery
A comprehensive C++ learning project combining in-depth documentation with practical, hands-on lessons. Master modern C++ through understanding first principles, memory management, zero-cost abstractions, and the STL.
Learn from first principles - understand the machine, then build abstractions.
C++ is unique because it gives you:
- Direct Memory Control - Understand every byte
- Compile-Time Computation - Shift work to the compiler
- Zero-Cost Abstractions - Pay only for what you use
This project teaches you why C++ works the way it does, not just how to write syntax.
cpp-step-by-step/
├── docs/ # 📚 Comprehensive documentation
│ ├── 00_foundations/ # Theoretical foundations
│ ├── 01_learning_path/ # Learning roadmap & milestones
│ ├── 02_memory_mastery/ # Deep dive into memory management
│ ├── 03_zero_cost_abstractions/
│ ├── 04_stl_mastery/ # STL containers, algorithms, iterators
│ ├── 05_modern_cpp/ # C++11/14/17/20/23 features
│ ├── 06_best_practices/ # Code style, design patterns
│ ├── 07_toolchain/ # CMake, debugging, profiling
│ ├── 08_advanced_topics/ # Concurrency, networking, graphics
│ ├── 09_interviews/ # Interview prep & career guide
│ ├── cheatsheets/ # Quick reference guides
│ ├── exercises/ # Practice problems (25+)
│ ├── resources/ # Curated books & videos
│ └── projects/ # Project ideas & templates
│
├── src/ # 💻 Practical lessons
│ ├── 01_memory_control/ # Stack, heap, pointers, RAII
│ ├── 02_zero_cost_abstraction/ # Classes, move semantics, templates
│ └── 03_toolbox/ # STL, modern features, build tools
│
├── tests/ # ✅ Lesson verification
├── CMakeLists.txt # Build configuration
└── README.md # This file
- Compiler: Clang 16+ (recommended) or GCC 13+ or MSVC 19.37+
- Build Tool: CMake 3.25+ and Ninja
- Platform: Windows, macOS, or Linux
# Clone the repository
git clone https://github.com/Clearzero22/cpp-step-by-step
cd cpp-step-by-step
# Configure and build
cmake -G Ninja -B build
cmake --build build
# Run a specific lesson
./build/bin/lesson01_stack_heap # Windows: .\build\bin\lesson01_stack_heap.exe
./build/bin/lesson02_pointers_references
./build/bin/lesson03_object_lifetime
./build/bin/lesson04_raiiWindows Quick Commands:
build.bat # Configure & build
run.bat # Run all lessonsStart with the theory, then write code:
-
Read:
docs/00_foundations/01_first_principles.md- What makes C++ unique
- The three pillars explained
-
Read:
docs/00_foundations/02_roadmap.md- Complete learning roadmap
- Skill milestones
-
Code: Complete
src/01_memory_control/lessons./build/bin/lesson01_stack_heap ./build/bin/lesson02_pointers_references ./build/bin/lesson03_object_lifetime ./build/bin/lesson04_raii
-
Study:
docs/02_memory_mastery/- Deep dive into stack vs heap
- Pointers and references internals
- Object lifetime and RAII
- Memory safety patterns
-
Practice:
exercises/02_intermediate/- 10+ memory-focused exercises
-
Build: Complete a project from
projects/01_cli_apps/
- Study:
docs/03_zero_cost_abstractions/ - Code:
src/02_zero_cost_abstraction/lessons - Master: Classes, move semantics, smart pointers, templates
- Study:
docs/04_stl_mastery/anddocs/05_modern_cpp/ - Code:
src/03_toolbox/lessons - Learn: CMake, debugging, profiling
| Module | Lessons | Progress |
|---|---|---|
| Memory Control | 16 | 100% |
| Documentation | 50+ | 100% |
| Cheatsheets | 3 | 100% |
| Exercises | 25+ | 100% |
| Projects | 16 | 100% |
| Module | Lessons | Progress |
|---|---|---|
| Zero-Cost Abstraction | 0 | 0% |
| Toolbox (STL) | 0 | 0% |
| Modern Features | 0 | 0% |
| Documentation | Code Lessons | Status |
|---|---|---|
02_memory_mastery/ |
src/01_memory_control/ |
✅ Complete |
03_zero_cost_abstractions/ |
src/02_zero_cost_abstraction/ |
📝 Planned |
04_stl_mastery/ |
src/03_toolbox/01_stl/ |
📝 Planned |
05_modern_cpp/ |
src/03_toolbox/02_modern_features/ |
📝 Planned |
07_toolchain/ |
src/03_toolbox/03_compilation/ |
📝 Planned |
- First Principles - Understand C++'s core philosophy
- Hardware Fundamentals - How C++ maps to machine code
- Memory Model - Stack, heap, and everything in between
- Curated Books - Essential C++ reading list
- Video Tutorials - YouTube channels and conference talks
- Practice Projects - 16+ real-world project ideas
- Syntax Cheatsheet - Variables, functions, classes, templates
- STL Containers - Container selection and usage
- Modern C++ - C++11 to C++23 features at a glance
- Basics - Variables, control flow, functions
- Intermediate - Memory, OOP, templates
- Advanced - Concurrency, systems, performance
This project uses CMake with Ninja for fast, parallel builds.
# Debug build (default)
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Debug
# Release build (optimized)
cmake -G Ninja -B build -DCMAKE_BUILD_TYPE=Release
# Clang with sanitizers
cmake -G Ninja -B build -DCMAKE_CXX_COMPILER=clang++ -DENABLE_SANITIZERS=ON# Build all lessons
cmake --build build
# Build specific target
cmake --build build --target lesson01_stack_heap
# Clean and rebuild
cmake --build build --clean-firstEach lesson includes assertions to verify understanding:
# Run all tests
ctest --test-dir build
# Run specific test
ctest --test-dir build -R lesson01
# Verbose output
ctest --test-dir build --verbose"Don't memorize syntax - understand the machine."
-
Theory → Practice → Mastery
- Read the concept in
docs/ - Write the code in
src/ - Experiment and measure
- Read the concept in
-
From Low-Level to High-Level
- Start with memory layout
- Add abstractions incrementally
- Build complex systems confidently
-
Always Question "Why?"
- Why use this feature?
- What's the runtime cost?
- What's the alternative?
- How does the compiler implement this?
docs/00_foundations/01_first_principles.mddocs/01_learning_path/01_roadmap.mdsrc/01_memory_control/(all lessons)
docs/02_memory_mastery/→src/01_memory_control/docs/03_zero_cost_abstractions/→src/02_zero_cost_abstraction/docs/06_best_practices/
docs/08_advanced_topics/docs/09_interviews/- Contribute to the project!
This project is under active development. Contributions welcome!
- Fork the repository
- Create a feature branch
- Add lessons or documentation
- Submit a pull request
| Component | Status | Progress |
|---|---|---|
| Documentation | ✅ Complete | 100% |
| Memory Control | ✅ Complete | 100% |
| Zero-Cost Abstraction | 🚧 In Progress | 0% |
| STL Mastery | 📝 Planned | 0% |
| Modern C++ | 📝 Planned | 0% |
| Toolchain | 📝 Planned | 0% |
MIT License - feel free to use this project for learning and teaching.
- Documentation:
docs/README.md - Learning Path:
docs/01_learning_path/README.md - Exercises:
docs/exercises/README.md - Projects:
docs/projects/README.md
Status: 🚧 Under Active Development
Version: 1.0.0
C++ Standard: C++23
Last Updated: 2026-02-03
"C++ makes it harder to shoot yourself in the foot, but when you do, you blow off your whole leg."
— Bjarne Stroustrup (creator of C++)