Kernighan's Lever
linusakesson.net·18h·
Discuss: Hacker News
💻Programming
Preview
Report Post

Brian Kernighan famously wrote:

Everyone knows that debugging is twice as hard as writing a program in the first place. So if you’re as clever as you can be when you write it, how will you ever debug it?

The Elements of Programming Style, 2nd edition, chapter 2

The following version also circulates on the net:

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

This second quote may or may not be by Kernighan — the questionable use of "by definition" makes me uncertain — but it is useful as a provocative sound bite conveying the same essential idea.

It is tempting to interpret Kernighan’s aphorism as a…

Similar Posts

Loading similar posts...