DRY

expression

programming

Stands for: Don't Repeat Yourself

The principle that every piece of knowledge should have a single, authoritative representation in a system.

Coined in The Pragmatic Programmer, DRY says duplicated logic means duplicated bugs and drift, so you factor the shared idea into one place. Its counterpart is a caution - forcing unlike things to share code just because they look similar is its own trap - so DRY is about knowledge, not mere text.

Also known as: Don't Repeat Yourself, DRY principle

Sources

  • Hunt & Thomas, 'The Pragmatic Programmer' (1999)

All glossary entries