60
Maintainability
DRY Principle
Every piece of knowledge has one authoritative representation.
The article
If
Duplicated knowledge drifts, because nothing forces the copies to change together. The cost is not the extra characters — it is that some future editor fixes one copy and ships a system that now quietly contradicts itself.
Then
“Deduplicate knowledge, not text. Before merging two similar blocks, ask whether they change for the same reason and at the request of the same person; if not, leave them apart.”
Unless
Duplication Is Cheaper Than the Wrong Abstraction — two blocks that merely look alike today will fight each other the moment they need to diverge
Source
Andrew Hunt & David Thomas, The Pragmatic Programmer (Addison-Wesley, 1999) — "every piece of knowledge must have a single, unambiguous, authoritative representation within a system."
Go to the sourceSee also