Development Mistakes And How To Prevent Them
summary
Shows how raw C handles become safe by using unique_ptr with custom deleter so moves are explicit and double-free bugs disappear, demonstrates replacing small abstract base classes with lambda callbacks instead of inheritance and std::function to avoid boilerplate, and argues that a single-threaded, event-driven model with Boost.Asio io_service event loop and timers scales far better than a thread-per-request approach (thousands of threads) — examples and small demos compile and behave as expected.
AI-written summary · about
chapters (10)
- 0:00Introduction and motivation
- 4:54Traditional C-style handles in C++
- 11:01Using smart pointers for safety
- 13:11Wrapping handles with unique pointers
- 22:16Avoiding abstract base classes
- 26:15Lambda-based device control
- 35:57Multithreading pitfalls
- 41:27Single-threaded event loops
- 49:08Asio for embedded systems
- 53:55Conclusion and Q&A
