Better Code: Relationships
summary
Crashes usually trace to mismanaged relationships, so the presentation demonstrates concrete fixes: model ownership and witnessed relationships to track copies/moves and avoid iterator invalidation; treat STD move as unsafe because it can invalidate meaning; refactor a save-after-idle timer by injecting a timer and scheduler (no globals) and it works with zero heap allocations; replace unordered_map registries with a compact vector+optional Russian coat-check pattern that minimizes allocations and yields huge practical speedups (author measures a ~640x iteration-time gap driven by allocations).
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:37The role of relationships
- 3:45Defining entities and connections
- 10:41Witnessed relationships
- 14:07Meaning and representation
- 19:55Safety and efficiency
- 24:17Concepts and axioms
- 30:20Contracts and constraints
- 35:16Composite objects
- 38:17Architecting with intention
- 48:16Registry patterns
- 58:40Consistency and contradictions
- 1:14:48Conclusion and Q&A
related talks
01h 39mBetter Code: Relationships
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
56mIdentifying Common Code Smells
39mTemporal Dynamics - Exploring the Intricacies of Object Lifetimes in Modern C++
40mLessons from two decades of writing bad code
01h 01mRecipes for Reducing Allocations by C++ Containers
54mC++ Common Knowledge
01h 00mMoving Faster: Everyday efficiency in modern C++
