Typing++ for C++ - Making the Compiler Do the Thinking
summary
Argues that adding small, explicit strong types moves many bugs to compile time and shows a tiny C++ library (a standalone file inside TTL) that wraps scalars with unique tag enums so the object code stays identical but invalid unit combinations fail to compile. Demonstrates with an automated generator that as expressions gain more distinct types ~90% of combos fail at three types and experiments give an average 22% rejection rate. Library is 99 lines, yields zero-runtime overhead and requires explicit conversions for cross-unit operations.
AI-written summary · about
chapters (13)
- 0:00Introduction and background
- 1:54Why strong typing matters
- 3:24Types in everyday life
- 6:14Overcoming resistance to typing
- 7:15How strong types work in C++
- 9:19Type consistency and operations
- 12:10Real-world bug prevention
- 15:40Monkeys writing code experiment
- 18:54Typing as a validation filter
- 21:02System-level type robustness
- 23:46Avoiding over-typing pitfalls
- 25:30Trying the typing library
- 26:35Q&A and closing remarks
