"Beware of bugs in the above code; I have only proved it correct, not tried it"
About this Quote
Knuth’s line lands because it punctures a myth programmers still cling to: that “correct” is a property you can simply stamp onto software. The joke turns on a sly reversal of status. A proof is supposed to outrank a test; here it’s treated like the more fragile accomplishment. That inversion is classic Knuth: mathematician’s rigor delivered with a hacker’s shrug, inviting laughter while quietly indicting both camps.
The specific intent is not to dismiss formal verification but to warn against confusing different kinds of certainty. A proof lives inside an abstract model: assumptions about the language semantics, the hardware, the specification, even what “the above code” is intended to do. Run the program and you collide with reality’s messy edges: undefined behavior, compiler quirks, off-by-one misunderstandings in the spec, the input you didn’t imagine because the user is creative in the worst way. Knuth’s punchline is that correctness is conditional, while failure is opportunistic.
The subtext is also about ego and incentives. In engineering culture, proofs can become rhetorical weapons: a way to end debate, to signal brilliance, to ship confidence. Testing, by contrast, is humble work; it assumes you might be wrong and then goes looking for evidence. Knuth flatters the reader with the romance of proof, then undercuts it by suggesting the most basic act of care: trying the thing.
Context matters: Knuth sits at the junction of mathematics and computer science, a field where “program” can be theorem and product at once. The line functions as a cultural safety valve - a reminder that software reliability is as much sociology (assumptions, handoffs, incentives) as logic.
The specific intent is not to dismiss formal verification but to warn against confusing different kinds of certainty. A proof lives inside an abstract model: assumptions about the language semantics, the hardware, the specification, even what “the above code” is intended to do. Run the program and you collide with reality’s messy edges: undefined behavior, compiler quirks, off-by-one misunderstandings in the spec, the input you didn’t imagine because the user is creative in the worst way. Knuth’s punchline is that correctness is conditional, while failure is opportunistic.
The subtext is also about ego and incentives. In engineering culture, proofs can become rhetorical weapons: a way to end debate, to signal brilliance, to ship confidence. Testing, by contrast, is humble work; it assumes you might be wrong and then goes looking for evidence. Knuth flatters the reader with the romance of proof, then undercuts it by suggesting the most basic act of care: trying the thing.
Context matters: Knuth sits at the junction of mathematics and computer science, a field where “program” can be theorem and product at once. The line functions as a cultural safety valve - a reminder that software reliability is as much sociology (assumptions, handoffs, incentives) as logic.
Quote Details
| Topic | Coding & Programming |
|---|
More Quotes by Donald
Add to List





