Better Code: Relationships
summary
Claim: software defects mostly come from mismanaged relationships, so model relationships explicitly and you avoid contradictions. Uses C++20 concepts (contracts absent) to express type axioms, treats things like iterators as witness relationship objects, and models whole/part ownership to prevent invalid states. Builds a registry using the Russian coat-check pattern: vector of optional slots + binary search + periodic compress, trading cheap inserts for very fast iteration — measured about a 640× gap in performance across sizes up to 2^20.
AI-written summary · about
chapters (32)
- 0:00Start
- 5:01Constraints
- 7:01Implicit Relationship
- 7:41Witnessed Relationships
- 9:22The Board
- 12:29Safety
- 13:15Partially Formed Object
- 14:51Fundamentals of Generic Programming
- 16:18Copy Properties of Copy and Assignment
- 17:11Natural Total Order
- 18:12Quantified Axioms
- 18:53Contracts
- 21:13Pattern Matching
- 23:15The Whole Part Relationship
- 24:19Composite Objects
- 26:26Architecture
- 30:54Photoshop Document
- 32:04Compositing Engine
- 35:40What Is Architecture
- 43:11Execution Context
- 50:04Binary Search
- 55:17Double Entry Bookkeeping
- 57:57Null Pointer Dereferences
- 1:02:45Why no Raw Synchronization Primitives
- 1:07:12Do I Always Look at Everything from an Architecture Perspective
- 1:07:36Scan the Code for Loops
- 1:13:52Mark Hamburg
- 1:14:59Ken Thompson
- 1:16:05What Advice Would You Give for Finding an Implementation of an Algorithm
- 1:28:24Memory Dynamic Operation
- 1:32:58Explicit Move and and R Value References
- 1:37:11Dynamically Linking
related talks
01h 20mBetter Code: Relationships
54mWriting C++ to Be Read
01h 07mDesign Patterns in Modern C++
01h 18mProper Inheritance
01h 01mEasy to Use, Hard to Misuse: Declarative Style in C++
01h 28mModern C++ Design reloaded
01h 05mAbstraction Patterns: Making Code Reliably Better Without Deep Understanding
58mA Practical Guide to Loose Coupling
