3 ms·
My boundary on DRYing has settled on "when it's semantically the same code". Code that looks the same but is used for different purposes / has different meanin
by Groxx 6y ago
My boundary on DRYing has settled on "when it's semantically the same code".
Code that looks the same but is used for different purposes / has different meaning? Keep it separate. They may diverge in the future.
Code that truly means the same thing, but may or may not look the same? DRY it up, any variation is probably unintended and will surprise people later when A doesn't behave like B.
- vlfig 6y agoExactly this. One thing is to have (today) the same behaviour, another is to (forever) be the same thing.