Empiriceme · Figure · Adage / Folk Law

Kernighan's Law

Debugging is twice as hard as writing the code, so code written as cleverly as possible cannot be debugged by its author.

Kernighan's corollary is the operative part: if you write code at the limit of your cleverness, you are by definition not clever enough to debug it.

In practice

  • An engineer writes a one-line expression that handles four cases and cannot explain it to themselves six weeks later at 3am.
  • A finance model built with elegant nested formulas cannot be checked by the person who built it once the numbers look wrong.
Subject
Technology & Software
Essay
The programmers' folklore, and technology's place in society

Search every entry·Every entry, A to Z