Giao diện
C++ Engineering Module
Làm chủ ngôn ngữ của hiệu năng — Từ quản lý bộ nhớ đến Modern C++17
Tại sao C++?
C++ không chỉ là một ngôn ngữ lập trình — nó là nền tảng của computing. Từ game engines (Unreal), browsers (Chrome), đến embedded systems và AI frameworks (TensorFlow core), C++ vẫn thống trị mọi nơi hiệu năng là tối quan trọng.
🎯 PENALGO C++ Philosophy
Chúng tôi không dạy C++ như một ngôn ngữ cũ. Chúng tôi dạy Modern C++ (C++17/20) với mindset của Systems Engineer — hiểu sâu về memory, ownership, và performance.
Learning Path
┌─────────────────────────────────────────────────────────────────┐
│ C++ ENGINEERING ROADMAP │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 📘 MODULE 1: BASICS 🏛️ MODULE 2: OOP │
│ ├─ Memory Model (Stack/Heap) ├─ Class Anatomy │
│ ├─ Variables & Types ├─ Inheritance │
│ ├─ Pointers & References └─ Polymorphism │
│ └─ Functions & Control Flow │
│ │
│ 🔧 PART 5: TEMPLATES ⚡ PART 6: CONCURRENCY │
│ ├─ Function/Class Templates ├─ std::thread, mutex │
│ └─ C++20 Concepts └─ async/future, atomics │
│ │
│ 🧠 PART 9: MEMORY 🏗️ PART 10: BUILD SYSTEMS │
│ ├─ RAII & Smart Pointers ├─ Modern CMake │
│ └─ Rule of 5 ├─ Conan/Vcpkg │
│ └─ CI/CD (GitHub Actions) │
│ │
│ 🌐 PART 11: NETWORKING 🧪 PART 12: TESTING │
│ ├─ Protobuf (21x faster) ├─ GTest/GMock │
│ ├─ gRPC Framework ├─ Dependency Injection │
│ └─ Async I/O (Boost.Asio) └─ TDD (Red→Green→Refactor) │
│ │
│ 🔧 PART 13: DEBUGGING 🏛️ PART 14: DESIGN PATTERNS │
│ ├─ Sanitizers (ASan/TSan) ├─ Pimpl (ABI Stability) │
│ ├─ Linux Perf/FlameGraphs ├─ Singleton (Meyers') │
│ └─ GDB (Core Dumps) └─ Observer, Strategy │
│ │
└─────────────────────────────────────────────────────────────────┘Modules hiện có
📘 Part 1 & 2: Basics Available
Nền tảng vững chắc về C++ — Memory Model, Variables, Pointers, Control Flow, và Functions.
- Part 1: Memory Model, Variables & Types, Pointers & References, I/O
- Part 2: Control Flow, Modern Loops, Functions, Scope & Lifetime, const
🏛️ Part 3: Object-Oriented Programming Available
Encapsulation, Inheritance, Polymorphism — Tư duy đối tượng.
- Part 1: Classes, Access Modifiers, this pointer, Member Init
- Part 2: Inheritance, Virtual Functions, Polymorphism, Abstract Classes
- 🎮 Projects: RPG Character + RPG Class System
📦 Part 4: STL Containers Available
Standard Template Library — Containers và Performance Analysis.
- The Big 3: std::vector, std::string, std::map/unordered_map
- Algorithms: sort, find, transform, accumulate với lambdas
- Performance: Big O analysis cho mọi container
🔧 Part 5: Templates Available
Generic Programming — DRY principle với Templates.
- Function Templates: Generic functions
- Class Templates:
Box<T>, custom containers - Specialization: Full và partial specialization
- 🚀 C++20 Concepts: Modern template constraints
⚡ Part 6: Concurrency Available
Lập trình đa luồng — Threads, Race Conditions, và Synchronization.
- Threads: std::thread spawning & joining
- Race Conditions: Demo data corruption
- Synchronization: mutex, lock_guard, unique_lock
- ☠️ Deadlocks: Dining Philosophers Problem
🔗 Part 7: Graph Algorithms Available
Thuật toán đồ thị — Biểu diễn và Duyệt đồ thị.
- Representation: Adjacency Matrix vs List
- BFS: Breadth-First Search
- DFS: Depth-First Search
- Applications: Shortest path, Cycle detection
🔌 Part 8: Embedded Programming Available
Lập trình nhúng — Gần gũi với phần cứng.
- Memory Constraints: Low RAM/ROM coding
- Bit Manipulation: Register control
- volatile: Hardware mapping
- Interrupts: ISR basics
🧠 Part 9: Memory Management Available
Quản lý bộ nhớ hiện đại — RAII và Smart Pointers.
- RAII: Resource Acquisition Is Initialization
- Smart Pointers: unique_ptr, shared_ptr, weak_ptr
- Rule of 5: Copy/Move constructors, assignments
🏗️ Part 10: Build Systems Available
Hệ thống build chuyên nghiệp — CMake, Package Management, CI/CD.
- Modern CMake: Target-based approach (PUBLIC/PRIVATE/INTERFACE)
- Package Management: Conan & Vcpkg
- Build Optimization: Ninja, CCache, Sanitizers
- CI/CD: GitHub Actions matrix builds
🌐 Part 11: Networking HFT Grade
High-Performance Networking — Protobuf, gRPC, Async I/O cho Low-Latency Systems.
- Serialization: Protobuf (21x faster than JSON)
- RPC Framework: gRPC cho microservices
- Async Engine: Boost.Asio, C++20 Coroutines
- Production: Zero-copy, Load testing, TLS/SSL
🧪 Part 12: Testing Zero Defect
Production Quality Assurance — Google Test, Google Mock, TDD cho Mission-Critical Systems.
- GTest: ASSERT/EXPECT, Fixtures, Parameterized Tests
- GMock: Dependency Injection, MOCK_METHOD, EXPECT_CALL
- Advanced: Boundary Analysis, Flaky Tests, Code Coverage
- TDD: Red → Green → Refactor
🔧 Part 13: Debugging System Surgery
Advanced Debugging & Profiling — Sanitizers, Valgrind, GDB, Linux Perf cho SRE/Performance Engineers.
- Sanitizers: ASan, TSan, UBSan (Shadow Memory)
- Profiling: Valgrind, Linux Perf, FlameGraphs
- GDB: Core Dumps, Interactive Debugging, TUI Mode
- Logging: spdlog, Structured Logging, Request Tracing
🏛️ Part 14: Design Patterns Architecture
Design Patterns for Distributed Systems — Pimpl, Singleton, Observer, Strategy cho Tech Leads.
- Pimpl: ABI Stability, Compile-time Firewall
- Singleton: Meyers' Singleton, Magic Statics
- Observer: Pub/Sub, Event-driven Architecture
- Strategy: Composition over Inheritance
So sánh với ngôn ngữ khác
| Đặc điểm | C++ | Rust | Go | Python |
|---|---|---|---|---|
| Quản lý bộ nhớ | Manual (new/delete) | Ownership System | GC | GC |
| Hiệu năng | ⚡⚡⚡ | ⚡⚡⚡ | ⚡⚡ | ⚡ |
| Learning curve | 📈📈📈 | 📈📈📈 | 📈 | 📈 |
| Null safety | ❌ (có nullptr) | ✅ (Option) | ✅ (nil check) | ❌ (None) |
| Concurrency | Manual | Fearless | Goroutines | GIL limited |
"Premature optimization is the root of all evil. But pessimization is even worse."