04 / Guías
Guía de recuperación moderna de C++
Modern C++ Recovery Guide
Una wiki rápida y práctica para quien aprendió C++ alrededor de 2008 y desea recuperarse rápidamente a C++ moderno (C++17/20).
Cómo usar este wiki
Recorre las páginas en orden. No intentes memorizar todo. Para cada tema, trata de entender:
- ¿Qué problema resuelve esto?
- ¿Qué prefiere el C++ moderno?
- ¿Cuáles son los modos de falla más comunes?
- ¿Puedo escribir un pequeño ejemplo de memoria?
Ruta recomendada
Fase 1 — Reconstruir el núcleo
- Modelo mental: Modern C++
- Compilación, enlace y forma del proyecto
- Tiempo de vida de los objetos, pila, montón y RAII
- Propiedad, punteros crudos y punteros inteligentes
- Semántica de valores y regla de 0/3/5
Fase 2 — Características modernas del lenguaje
- Semántica de movimiento
- Const, referencias y paso de parámetros
- Contenedores y algoritmos de la STL
- Sintaxis moderna: auto, lambdas, enum class, constexpr
- Optional, Variant, String View, Span, Filesystem, Chrono
- Plantillas y programación genérica
Fase 3 — C++ serio
- Manejo de errores y seguridad de excepciones
- Concurrencia: hilos, mutexes, atómicos
- Comportamiento indefinido y seguridad de memoria
- Fundamentos de rendimiento
- Herramientas: CMake, depuradores, sanitizadores, pruebas
Fase 4 — Elegir un dominio
Plan Práctico Más Rápido
Si deseas un sprint de 30 días:
- Semana 1: RAII, propiedad, punteros inteligentes, semántica de valores.
- Semana 2: semántica de movimiento, STL, lambdas, sintaxis moderna.
- Semana 3: CMake, depuración, sanitizadores, pruebas, conceptos básicos de concurrencia.
- Semana 4: crear un proyecto serio.
Pila de Objetivo Predeterminada
C++17/20 + Linux + CMake + gdb/lldb + sanitizers + GoogleTest/Catch2 + Python para automatización.
Esa combinación te brinda una base técnica duradera y te mantiene productivo.
Fundamentación
Esta es una guía rápida de recuperación, no un sustituto del estándar o de un libro de texto completo. Para referencias autorizadas y notas de versiones, vea Fundamentación y Referencias.
01 — Modern C++ Mental Model
Modern C++ is not “C with classes.” It is a language for building efficient systems using explicit ownership, deterministic cleanup, value semantics, and z
02 — Compilation, Linking, and Project Shape
C++ is usually built in separate translation units. Understanding the build process saves hours of confusion.
03 — Object Lifetime, Stack, Heap, and RAII
C++ is a lifetime language. To write good C++, you must know when objects are created, when they are destroyed, and who owns resources.
04 — Ownership, Raw Pointers, and Smart Pointers
Modern C++ code should make ownership obvious.
05 — Value Semantics and Rule of 0/3/5
Modern C++ prefers types that behave like values. A good type can be copied, moved, stored in containers, returned from functions, and destroyed safely.
06 — Move Semantics
Move semantics let C++ transfer resources instead of copying them.
07 — Const, References, and Parameter Passing
Function signatures should communicate ownership, mutation, and optionality.
08 — STL Containers and Algorithms
The standard library is the default toolbox. Modern C++ code should use containers and algorithms instead of manual memory and hand-written loops everywher
09 — Modern Syntax: auto, Lambdas, enum class, constexpr
Use `auto` when the type is obvious or verbose.
10 — Modern Library Types
Use when a value may or may not exist.
11 — Templates and Generic Programming
Templates let you write code that works with many types while still being compiled into efficient type-specific code.
12 — Error Handling and Exception Safety
C++ has multiple error handling styles. The right one depends on the domain.
13 — Concurrency: Threads, Mutexes, Atomics
Concurrent code lets multiple things happen at once, but introduces data races, deadlocks, ordering issues, and debugging pain.
14 — Undefined Behavior and Memory Safety
Undefined behavior means the C++ standard places no requirements on what happens. The program may appear to work, crash, corrupt data, or become vulnerable
15 — Performance Fundamentals
C++ gives you control over performance, but you must measure. Guessing is unreliable.
16 — Tooling: CMake, Debuggers, Sanitizers, Testing
Modern C++ skill includes tooling. Real C++ work is not just language syntax.
17 — Domain Tracks
C++ becomes most valuable when attached to a serious domain. Do not learn endless syntax in isolation.
18 — Project Ideas
A serious project beats passive study. Pick one project that forces you to use modern C++ features, tooling, debugging, and domain concepts.
19 — Quick Checklist
Use this as a fast self-assessment.
20 — Grounding and References
Authoritative references used to ground the Modern C++ Recovery Guide.