MechanismArticle · 50:20 — 53:00
Formal methods require too much effort for the exotic edge cases they catch — even a simple file-line-counting problem becomes a nightmare to specify.
Real-world specs are a nightmare to write: even a simple problem like 'find the file with the most lines' forces questions about ASCII vs UTF-8, unreadable files, and symlinks. Without formal methods, we can write something correct 99%+ of the time with far less effort. ✦ AI generated
Hillel Wayne · The Pragmatic Engineer · 2026-07-29 · original ↗
It's because specs in the real world are a nightmare to write. Even a simple problem like 'find the file in a directory that has the most lines' gets complicated when modeled with formal methods. We would have to answer questions like: 'do we look at ASCII or UTF-8 new line characters, what about unreadable files, and Symlinks?' Without formal methods, we can write a simple verification that is right in 99%+ of cases. Formal methods require a lot of extra effort for the less than 1% of exotic use cases!
Read full article ↗excerpt · fair-use quotation
Around this claim
This moment responds to
rebuts → Amazon used TLA+ to find a bug whose shortest error trace was 35 steps — a bug that would have been impossible to find through conventional testing.Hillel Wayne · The Pragmatic Engineerrebuts → Software engineering earns the right to be called 'engineering' because of the rigor it demands.Hillel Wayne · The Pragmatic Engineerprovides context → Most engineers should adopt property-based testing and stop there — it is the most practical lightweight formal method.Hillel Wayne · The Pragmatic Engineerprovides context → AI won't make formal verification mainstream, but it will increase its use — from maybe 0.1% to 0.3% of the industry, which would still be huge.Hillel Wayne · The Pragmatic Engineer