📎 Webclip
Null References: The Billion Dollar Mistake
Tony Hoare says null references were added in 1965 because they were easy to implement, but he treats that decision as a costly mistake. The talk connects null checking, bounds checking, and type checking to a broader argument that language designers should take responsibility for preventing errors in the programs people write.
Reading notes#
- Null references were introduced in ALGOL W for ease of implementation, not because they were a sound design choice.
- Array bounds checks add cost, but they prevent undetected errors and became standard in later mainstream languages.
- Pointer-based designs can cause serious failures when values are used as addresses by mistake.
- Hoare argues that type checking can prevent whole classes of errors and that customers usually chose safety once they saw the tradeoff.
- He describes null as something that forces checks on every reference and sees non-null references as a later correction.
- He says language designers should accept responsibility for user mistakes and design languages that make correctness easier to prove.
- He links reliability, analysis, and formal verification to safer programming language design.
- He also connects unsafe library functions in C, especially gets, to buffer overflows and the growth of malware.
