DEV Community

Discussion on: Stop trying to be so DRY, instead Write Everything Twice (WET)

carlosmgspires profile image
Carlos Pires

You are confusing two very different concepts.
DRY is not about code: it's about the model (representation).
It's about having a "single source of truth". There is no "premature optimisation" whatsoever in that. It's just good programming practice.

What you are talking about is implementation and levels of abstraction. There you can have premature optimisation and over-engineering, and you sure need to be careful with that. But it has nothing to do with DRY.