kernighans-lawlisted
Install: claude install-skill The-Artificer-of-Ciphers-LLC/skills-from-the-artificer
# Kernighan's Law
> "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?"
> — Brian Kernighan, 1974 (The Elements of Programming Style)
## The core idea
Writing clever code feels good. It demonstrates mastery and intelligence. But if you write code at the absolute limit of your ability to understand, you have no margin left to debug it when something goes wrong — and something will always go wrong.
The smarter move is to write code that is simpler than you're capable of. Leave yourself headroom.
## What "clever" code actually costs
**Time to understand:** Code that is dense, abstract, or uses advanced tricks is hard to read — for you, six months later, and especially for colleagues.
**Debugging difficulty:** When clever code breaks, the same cleverness that makes it compact also makes the failure mode opaque. You have to fully reconstruct the intent before you can find the bug.
**Review friction:** Code reviewers who don't immediately understand code are slower and less thorough. Bugs slip through.
**Maintenance burden:** Anyone who modifies the code must first understand it. Clever code has a high "understanding tax" that gets paid over and over.
**Onboarding cost:** New team members struggle with overly sophisticated patterns. Institutional knowledge doesn't transfer.
## What to prefer instead
**Explicit over implicit.** If the reader has to me