Refactoring Legacy C++ OOP Application Code with Functional Programming and Type Erasure Concepts
summary
Shows how to incrementally refactor a legacy C++ order-management codebase by extracting pure functions, replacing exception/bool error patterns with std::expected for monadic chaining and short‑circuiting, modeling states with std::variant to get exhaustiveness, and replacing intrusive inheritance with concept‑checked type‑erasers (std::function / move_only_function / any‑like wrappers) to build configurable declarative pipelines. Provides concrete migration steps: adapters for roundtrip compatibility, property tests (commutativity, idempotence), and reports partial real‑world adoption with reduced coupling and safer compile‑time guarantees.
AI-written summary · about
chapters (12)
- 0:00Legacy code modernization
- 3:30Risks in legacy OOP code
- 7:02Functional programming and type erasure
- 11:55Extracting pure functions
- 17:32Type-safe error handling with std::expected
- 25:20Decoupling with type erasure
- 34:57Type erasure with concepts
- 46:22State modeling with std::variant
- 50:11Declarative pipelines
- 56:34Migration strategies
- 1:02:34Action plan and trends
- 1:05:04Q&A
related talks
01h 31mFunctional Programming in Modern C++: The Imperatives Must Go!
01h 02mFunctional C++
49mThe Evolution of Functional Programming in C++
01h 03mFunctional C++ for Fun & Profit
49mWorking with C++ Legacy Code
01h 01mFunctional C++
01h 07mDesign Patterns in Modern C++
46mPractical Functional Programming in C++
