← Graph

DRY Principle

concept 2 connections

'Don't Repeat Yourself' — principle from Andy Hunt and Dave Thomas's book The Pragmatic Programmer: 'every piece of knowledge must have a single, unambiguous, authoritative representation within a system'. Chikahiro Tokoro stresses the word 'knowledge', not 'code': duplication that is merely coincidental (similarity without shared meaning) should not be dried up. His customer/invoice/receipt example shows that applying DRY to coincidental duplication produces a document God object, while treating invoice and receipt as different domain knowledge yields clean, naturally modular code. Dave Thomas personally told Chikahiro in Tokyo ~10 years ago that he regrets how he originally explained DRY because people misunderstood it.

category
principle
about
DRY Principle concept
Uses DRY-as-knowledge to explain how God objects emerge from over-eager de-duplication.
concept DRY Principle
related_to
DRY is defined in The Pragmatic Programmer.

Provenance

Read by
2 extractions