10 Tips for Cleaner C++ 20 Code
summary
Builds a small VOD app and iteratively refactors it so you can see each change: splits a bulky readMovies into readMovie + lazy generator via C++20 coroutines to avoid loading 10k files, replaces exceptions with TL expected / std expected for expected errors, introduces constructor injection and the header‑only IoC hypodermic to swap a mock streamer (tests shrink from waiting 20s), moves APIs into interfaces, prefers composition over implementation inheritance, and shows modules/head‑units work but tooling is uneven.
AI-written summary · about
chapters (12)
- 0:00Intro
- 1:02Implementation of the STL
- 4:35Clean code tradeoffs
- 7:59Best Practices for Software Design
- 17:05Managing headers
- 20:22Improving error handling
- 28:23Use generators for lazy iteration
- 36:55Refactoring Step
- 42:05Dependency Injection
- 42:43Constructor injection
- 44:14Inversion of Control Container
- 51:20Lessons Learnt








