DRY
Technology & Computing abbreviation · Programming
| Stands for | Don't repeat yourself |
|---|---|
| Categories | Technology & Computing |
DRY stands for Don't repeat yourself, a programming abbreviation.
A software principle stating that every piece of knowledge or logic should have a single, authoritative representation in a system, so changes need to be made in only one place. Copy-pasted code that must be updated in several spots violates it.
Example: Extract that validation into a helper; it's duplicated in four handlers and breaks DRY.
Usage notes
Formulated by Andy Hunt and Dave Thomas in "The Pragmatic Programmer" (1999), and meant to apply to documentation, schemas and configuration as well as code. Over-zealous DRY can create the wrong abstractions, so many developers follow the "rule of three", tolerating duplication until something appears a third time. The joking opposite is WET.
Related abbreviations
More programming abbreviations
- CVS – Concurrent Versions System
- DAO – Data access object
- DDD – Domain-driven design
- DFS – Depth-first search
- DI – Dependency injection
- DP – Dynamic programming
- DSA – Data structures and algorithms
- DSL – Domain-specific language
- DTO – Data transfer object
- DX – Developer experience
- E2E – End-to-end (testing)
- EDA – Event-driven architecture