Farasu on TelegramJoin
Back to books
Cover of The Pragmatic Programmer by Andrew Hunt & David Thomas

The Pragmatic Programmer

by Andrew Hunt & David Thomas · Published 1999

One of those books that teaches the mindset of a good software engineer rather than any particular technology. Principles like code ownership, automation, simplicity and continuous learning are still very much applicable.

What works

  • Timeless engineering principles.
  • Useful regardless of programming language.
  • Excellent emphasis on maintainability.
  • Practical and highly readable.

What doesn't

  • Some examples are dated.
  • A few principles can feel obvious to experienced engineers.
  • Doesn't replace deeper knowledge of software architecture or computer science.

Summary

The Pragmatic Programmer is about no particular language, framework or technology, and that is why it has lasted. Andrew Hunt and David Thomas wrote a book about a mindset: how a good software engineer approaches code, ambiguity and change. Its structure is a series of short, self-contained tips, each explaining one professional habit.

The idea governing the whole book is ownership. From the first chapter the authors take the position that code quality, project state and an engineer's own learning are all things they own — not things that happen to them. The rest of the book translates that stance into everyday decisions.

The second theme, more useful in practice, is resistance to brittleness. A large share of the advice — DRY, decoupling, automation, orthogonality — serves one goal: keep change cheap. The authors assume requirements will move, and define good software not as software that works correctly but as software you can alter without fear.

Key ideas

1. DRY is not about code

The book's best-known principle is routinely misread. "Don't Repeat Yourself" does not mean collapsing every two similar lines into a function. The authors' actual definition concerns knowledge: every piece of knowledge in a system should have a single, unambiguous, authoritative representation.

The distinction matters. Two blocks of code may be identical today while representing two different pieces of knowledge; merging them costs you later, because when one changes you have to prise them apart again. Conversely, a business rule repeated across three places — code, documentation and a database schema — is a genuine DRY violation even though no line of code is duplicated.

2. Orthogonality and the tracer bullet

Orthogonality means a change in one area does not displace another. The authors treat this not as an architectural ideal but as a practical test: if changing one behaviour forces you to touch five unrelated files, the system is not orthogonal and every subsequent change will cost more.

Software is not like building construction; it is closer to gardening — it needs constant pruning.

The tracer bullet complements this: rather than completing one layer at a time, build a thin but complete slice through the whole system that genuinely works, then thicken it. It differs from a prototype in that tracer code is not thrown away; it is the final skeleton.

3. Automation and distrust of manual work

The authors treat every repeated manual procedure as debt. Their argument is not about speed but about repeatability: work done by hand is done slightly differently each time, and those small differences are the source of bugs that are hard to reproduce.

This is the chapter that landed hardest in the industry. Much of what we now call CI/CD — automated builds, automated tests, repeatable deployment — was proposed here as a professional habit years before the tooling became common.

4. Brittle code and the broken window

The broken-window metaphor holds that one unrepaired defect licenses the next. When part of a codebase is visibly neglected, adding one more shortcut to it carries no psychological cost, and quality degrades quickly.

Alongside it, the authors press for defensive programming: make contracts explicit, check assumptions with assertions, and fail early. The reasoning is that an error surfaced where it occurs is cheap; the same error appearing several layers higher and later costs hours.

5. Rubber ducking: explaining instead of thinking in silence

One of the book's most lasting techniques — and in fact the origin of a phrase now common across the entire industry — is introduced here. The advice is simple: keep a rubber duck (or any other object) next to your monitor, and when you're stuck, explain the code to it line by line, as if it knew nothing at all.

The point is not that the duck answers back. The point is that the process of explaining explicitly and step by step surfaces the unstated assumptions hiding in your own head. Most bugs are found the moment you are forced to put into precise words something you had been treating as "obvious". The authors treat this as an instance of the book's larger principle: passive thinking hides an error; active explanation exposes it.

Who it's for

  • An engineer with two to five years' experience — the ideal point to read this; you have written enough code to recognise the problems, and habits are not yet fixed.
  • Anyone newly joined to a team — it supplies shared vocabulary (DRY, orthogonal, broken window) that genuinely helps in code review.
  • Anyone changing languages — because nothing in the book is tied to one language, it is exactly the part that transfers.
  • A team that has lost its quality bar — the chapters on technical debt and broken windows are a good frame for a team discussion.
If you have been writing code professionally for ten years, a good share of this will read as obvious — not because it is shallow, but because these ideas have become part of the profession's common sense. Its value to you is more in giving form to things you know but have never articulated.
Two limits. First, some examples have clearly dated; the second edition refreshed much of this, but if you are reading the 1999 original expect references to tooling nobody uses now. Second and more important: this book does not replace deeper knowledge of software architecture or computer science. It is about professional habits, not distributed systems, algorithms or database design. Those have to be learned elsewhere.

FAQ

First edition or the 20th-anniversary edition?

The second, if you have the choice. The examples are current and the concurrency and tooling material was rewritten. But if the first edition is what you have, the core principles have not changed and reading it is not wasted.

How does it compare to Clean Code?

Clean Code is about writing code; this is about being an engineer. Martin goes into detail — naming, function length, class structure — while Hunt and Thomas stay at the level of decisions and habits. If you read only one, this is the one that ages more slowly.

Is it suitable for a beginner?

It is useful but this is not the ideal moment. Most of the advice answers pains that stay abstract until you have felt them. After a year or two on a real codebase, the same sentences mean something different.

Can DRY be over-applied?

Yes, and it is the most common misuse of the book. Merging code that is only incidentally similar creates a coupling you later pay to undo. The correct test is sameness of knowledge, not sameness of text.

Which part is most immediately useful?

The automation and defensive-programming chapters. The general principles are inspiring, but those two convert directly into things you can do today: remove a manual step, make an assumption explicit, fail early instead of propagating an error.

Does rubber duck debugging actually work?

For most programmers, yes, and the reason is psychological rather than magical. The brain lets weak assumptions pass unexamined when it merely "thinks" something; when you're forced to explain the same thing in complete, ordered sentences to a listener — even an imaginary one — it has to be more precise. You don't need an actual duck; a colleague, or even writing the explanation into a text file, produces the same effect.

Was this useful?

Counts appear once there are 5 votes.

More in this genre

The Pragmatic Programmer | Pouya Karimi