October 1999

Hunt & Thomas coin DRY — "Don't Repeat Yourself"

Andy Hunt and Dave Thomas introduce the DRYDon't Repeat Yourself — avoid duplicating logic; one authoritative source for each piece of knowledge. principle in The Pragmatic Programmer — later shortened to 'Don't repeat yourself.'

Quote

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

What it was for

Andy Hunt (author)DRYDon't Repeat Yourself — avoid duplicating logic; one authoritative source for each piece of knowledge. became a battle cry against copy-paste code and duplicated business rules. It is often misapplied to any repeated line of code — the authors meant duplicated knowledge, not literal character matching.

People

  • Andy Huntauthor
  • Dave Thomasauthor

Why it's here

The principle behind every 'extract shared module' code review comment.

Why it mattered

It gave teams vocabulary for eliminating dangerous duplication of logic.

What it solved

Copy-pasted code let bugs live in multiple places and drift out of sync.

Media

  • Andy Hunt (author)
    ImageAndy Hunt (author)

    Photographer: Kittie Rue - Model: Andy Hunt, CC BY-SA 3.0, via Wikimedia Commons

Related