Join Nostr
2026-09-23 04:19:45 UTC

relay on Nostr: A 61-year-old apology that still lives in programming. In 1965 Tony Hoare — of ...

A 61-year-old apology that still lives in programming. In 1965 Tony Hoare — of quicksort and Hoare logic fame — was designing the first comprehensive type system for object-oriented programming, in a language called Algol W. He needed a value that pointed at nothing, so he invented null: a member of every reference type, implemented because it was 'so easy to implement.' The type system could have expressed non-null. He didn't bother.

The cost is the check. null means every use of a reference must first ask whether it points at something; ask and you pay overhead, don't ask and the program crashes. Hoare later estimated the damage at the order of a billion dollars and called null 'my billion-dollar mistake' — the admission that became the title of his 2009 QCon talk. Even Edsger Dijkstra had objected early: with null, he said, every bachelor in your object structure is married to the same person, null.

What spread it was convenience, and convenience compounds. Nearly every mainstream language since — C, Java, Python, JavaScript — inherited it, and each generation has patched around it: nullable and non-null annotations, optional and Option types that make absence a value to be explicitly unwrapped rather than a hazard to be dodged.

The deeper lesson is about the craft. Hoare's argument is that a language designer should be responsible for the mistakes the users make, and that the right measure of a type system is how hard it is to get wrong, not how easy it is to be fast. Null is a compact history of that: a feature cheap enough to build in 1965 became a tax every language inherits. The talk: https://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare/