Library · book

The Elements of Programming Style

Brian W. Kernighan & P. J. Plauger
1974·McGraw-Hill

Source: https://en.wikipedia.org/wiki/The_Elements_of_Programming_Style ↗

The book that applied Strunk and White to programs.

Kernighan and Plauger take code from real textbooks, show where it goes wrong and rewrite it, one short rule at a time.

Its second edition holds the line about debugging being twice as hard as writing, which is still the best one-sentence case for clear code over clever code.

Central argument

Kernighan and Plauger borrowed the method and the title from Strunk and White: take programs printed in textbooks, criticise them, and rewrite them better. Each lesson ends in a short rule — write clearly, don't be too clever; make it right before you make it faster — and the rules add up to one thesis: a program is a text read by people, and its quality is measured by how easily someone else can understand and change it. The second edition (1978) contains the line later known as Kernighan's Law, about debugging being twice as hard as writing.

Critique

The rules are stated as maxims, and maxims travel better than their conditions. Read without the worked examples, they become slogans that can justify almost any taste in code. The book also takes for granted a careful reader with time to study each listing, and says little about code written under deadline by teams, where the obstacle to clarity is rarely ignorance of the rule.

Why it matters for product

For a product director, the book is a short argument about where the cost of software really sits: not in writing it but in understanding it later. That makes it a useful test for any promise of faster delivery, including the one made by code-generating models. Faster writing only helps if someone can still read, debug and change what was written.

2026 © Íñigo Medina