Skip to content

Latest commit

 

History

History

01_learning_path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

C++ Learning Roadmap - Your Journey to Mastery

"从底层控制到高层抽象的系统化学习路径"


🎯 学习路线图

┌─────────────────────────────────────────────────────────────────┐
│                    PHASE 1: FOUNDATIONS (1-2周)                    │
│                                                               │
│  ✅ First Principles (硬件映射与高效抽象)                        │
│  ✅ Hardware Fundamentals (CPU、内存、执行模型)                     │
│  ✅ Memory Model (栈、堆、布局、对齐)                               │
│  │                                                               │
│  🎯 目标:建立底层认知框架                                         │
└─────────────────────────────────────────────────────────────────┘
                             ↓
┌─────────────────────────────────────────────────────────────────┐
│                    PHASE 2: MEMORY MASTERY (3-4周)                 │
│                                                               │
│  ✅ Stack vs Heap (内存分配策略)                                    │
│  ✅ Pointers & References (直接内存访问)                             │
│  ✅ Object Lifetime (对象生命周期管理)                             │
│  ✅ RAII Patterns (资源自动管理)                                   │
│  │                                                               │
│  🎯 目标:掌控内存,杜绝泄漏                                         │
└─────────────────────────────────────────────────────────────────┘
                             ↓
┌─────────────────────────────────────────────────────────────────┐
│              PHASE 3: ZERO-COST ABSTRACTION (4-6周)               │
│                                                               │
│  ⏳ Class Design (类设计与封装)                                    │
│  ⏳ Move Semantics (移动语义与性能优化)                             │
│  ⏳ Smart Pointers (现代内存管理)                                   │
│  ⏳ Template Basics (泛型编程基础)                                   │
│  │                                                               │
│  🎯 目标:写高效的抽象代码                                           │
└─────────────────────────────────────────────────────────────────┘
                             ↓
┌─────────────────────────────────────────────────────────────────┐
│                   PHASE 4: THE TOOLBOX (4-6周)                    │
│                                                               │
│  ⏳ STL Containers (容器选择与使用)                                  │
│  ⏳ STL Algorithms (通用算法库)                                     │
│  ⏳ Modern Features (C++11/14/17/20/23)                              │
│  │                                                               │
│  🎯 目标:掌握现代C++工具链                                         │
└─────────────────────────────────────────────────────────────────┘
                             ↓
┌─────────────────────────────────────────────────────────────────┐
│                   PHASE 5: ADVANCED TOPICS (按需学习)             │
│                                                               │
│  ⏳ Concurrency (多线程与并发)                                     │
│  ⏳ Networking (网络编程)                                          │
│  ⏳ Graphics (图形编程基础)                                        │
│  ⏳ System Programming (系统编程)                                  │
│  │                                                               │
│  🎯 目标:成为C++专家                                             │
└─────────────────────────────────────────────────────────────────┘

📊 学习里程碑

Milestone 1: Memory Aware (1-2 weeks)

You can:

  • ✅ Explain stack vs heap allocation
  • ✅ Use pointers and references correctly
  • ✅ Understand object lifetime
  • ✅ Apply RAII for resource management
  • ✅ Write leak-free code

Check:

// Can you answer these questions?
// 1. What happens when this function returns?
void func() {
    int* p = new int(42);
}
// 2. Why is RAII called "automatic"?
// 3. What's the difference between *ptr and &ref?

Milestone 2: Modern C++ Developer (3-4 weeks)

You can:

  • ⏳ Design classes with proper encapsulation
  • ⏳ Use move semantics to optimize performance
  • ⏳ Apply smart pointers for memory management
  • ⏳ Write function and class templates
  • ⏳ Use modern C++ features (auto, lambdas, etc.)

Check:

// Can you answer these questions?
// 1. When should I use std::move?
// 2. What's the Rule of Five?
// 3. How do I avoid memory leaks with smart pointers?

Milestone 3: STL Proficiency (4-6 weeks)

You can:

  • ⏳ Choose the right container for any use case
  • ⏳ Use STL algorithms effectively
  • ⏳ Write custom iterators and predicates
  • ⏳ Understand iterator categories
  • ⏳ Optimize container usage

Check:

// Can you answer these questions?
// 1. Why use std::unordered_map over std::map?
// 2. What's the complexity of std::find?
// 3. When should I use std::function vs lambdas?

Milestone 4: C++ Expert (6+ months)

You can:

  • ⏳ Design template libraries
  • ⏳ Write concurrent code
  • ⏳ Optimize for performance
  • ⏳ Design system architectures
  • ⏳ Mentor other developers

🎯 Phase Breakdown

Phase 1: Foundations

Time: 1-2 weeks

Focus: Understanding C++ fundamentals

Activities:

  • Read first principles docs
  • Complete src/01_memory_control/ lessons
  • Practice with simple exercises
  • Build mental models of memory

Outcomes:

  • Solid understanding of stack/heap
  • Pointer and reference proficiency
  • RAII as second nature

Phase 2: Memory Mastery

Time: 3-4 weeks

Focus: Complete memory control

Activities:

  • Master all memory_control lessons
  • Read memory_mastery documentation
  • Practice with memory-intensive projects
  • Profile and optimize memory usage

Outcomes:

  • Zero leaks guaranteed
  • Efficient memory layouts
  • Understanding of performance characteristics

Phase 3: Zero-Cost Abstraction

Time: 4-6 weeks

Focus: Building efficient abstractions

Activities:

  • Learn class design principles
  • Master move semantics
  • Use smart pointers effectively
  • Template fundamentals
  • Measure and optimize abstractions

Outcomes:

  • Classes that are both safe and fast
  • Code that doesn't pay for what it doesn't use
  • Zero-cost abstractions understood

Phase 4: The Toolbox

Time: 4-6 weeks

Focus: Leveraging the ecosystem

Activities:

  • Learn STL containers and algorithms
  • Master modern C++ features
  • Understand build systems
  • Use profiling tools

Outcomes:

  • Productive with STL
  • Modern C++ code style
  • Effective debugging and optimization

Phase 5: Advanced Topics

Time: Ongoing (as needed)

Focus: Specialized domains

Activities:

  • Choose your domain (graphics, networking, etc.)
  • Deep dive into advanced topics
  • Contribute to open source
  • Build portfolio projects

📈 Progress Tracking

Current Status

Phase Status Progress Time Spent
Foundations ✅ Complete 100% -
Memory Mastery ✅ Complete 100% -
Zero-Cost Abstraction 🚀 In Progress 5% -
The Toolbox 📝 Planned 0% -
Advanced Topics 📝 Planned 0% -

Overall Progress: 20% Complete


🎓 Recommended Resources

Books

  • "The C++ Programming Language" by Stroustrup
  • "Effective Modern C++" by Scott Meyers
  • "C++ Primer" by Lippman et al.

Online


✅ Milestone Checklist

Foundation Milestones

  • Read and understand first principles
  • Understand CPU and memory architecture
  • Grasp C++ memory model
  • Know how compilers work

Memory Mastery Milestones

  • Complete all memory_control lessons
  • Never write a memory leak
  • Understand every byte of your objects
  • Can reason about memory layout

Zero-Cost Abstraction Milestones

  • Design classes efficiently
  • Use move semantics appropriately
  • Choose right smart pointer type
  • Write template functions
  • Measure abstraction overhead

Toolbox Milestones

  • Use STL containers correctly
  • Apply STL algorithms
  • Write modern C++ code (C++17/20)
  • Use CMake effectively
  • Profile and optimize code

Next: Start with 02_milestones.md for detailed timeline and goals.