Contractual Disappointment in C++
summary
Lays out four concrete contract kinds (C++ API, standard, end‑user, and a test-user contract), shows a PID controller assert and a real bug where a sentinel UID of -1 causes a 4 billion-bit allocation, and argues to run ASAN/UBSAN, static analyzers, fuzzing and coverage before turning on optimizations. Demonstrates a cmake “test” build with extra flags, uses death tests to verify abort behavior, and pushes a fail-fast posture summed as “don’t optimize until you sanitize.”
AI-written summary · about
chapters (9)
- 0:00Start
- 4:25Types • C++ API Contracts
- 7:47The exchange of promises between the user and developer of a software product.
- 11:09Errors are things that can go wrong - even in perfect programs.
- 12:55Recap client violations of the End User Contract should be handled by the program
- 13:58$1,000,000 Question How does your program handle errors?
- 30:55Example of Client C++ API Contract Violation #1 PID Controller
- 45:50The exchange of promises between C++ developers and C++ implementers.
- 59:55Test User Contract
related talks
01h 17mFunction Contracts in Practice using C++
01h 30mContracts, Safety, and the Art of Cat Herding
01h 03m“Contract Programming in C++(20) (part 1 of 2)”
01h 05m“Contract Programming in C++(20) (part 2 of 2)”
57mPerspectives on Contracts for C++
01h 22mContracts, Safety and Correctness in C++
58mAvoid Misuse of Contracts!
56mContracts for Dependable C++
