Software Engineering ยท Code Quality
"Don't Repeat Yourself" โ any piece of knowledge or logic should exist in exactly one place in a system.
Example: Writing shared logic once and reusing it instead of copy-pasting it.
In practice: Applied too aggressively, DRY can create unwanted coupling between unrelated parts of a codebase that just happen to look similar today; the 'rule of three' โ duplicate twice before abstracting โ is a common guardrail.
Debated: Increasingly criticized โ Sandi Metz and others argue that deduplicating code that merely looks similar, rather than sharing a true business rule, creates false coupling worse than the duplication it removed.