Post

Debates over DRY (Don't Repeat Yourself) versus WET (Write Everything Twice) tend to miss the point. It's not about how many times you write something. DRY is not just a form of data compression, sharing code just so you can have less code.

The real cost of repetition is that code that should change in unison doesn't: if you fix a bug in one copy, the other is still broken. So the real decision point is: use shared code if the commonalities are fundamental; make separate copies if the commonalities are coincidental.

0 reposts0 likes

When in doubt, DRY is the better starting point, because if you're wrong, it's pretty easy to turn DRY into WET: just clone the code and customize it. In contrast, it's very hard to turn WET back into DRY if the copies have diverged.