DRY Is the Most Misunderstood Rule in Programming
This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).
DRY (Don't Repeat Yourself) is widely misunderstood as a rule about eliminating identical-looking code, but its original definition from The Pragmatic Programmer is about knowledge, not syntax. Two pieces of code can look the same yet represent entirely different domain concepts — merging them creates wrong abstractions that are harder to undo than the duplication they replaced. The author illustrates this with address validation and shared Order types across module boundaries, showing how premature deduplication introduces hidden coupling. The recommended approach: wait for the third occurrence, then ask whether both copies encode the same fact and must change together. If yes, extract. If not, leave them separate. Good abstractions are discovered from concrete cases, not guessed upfront.