3 ms·
There's an aspect of "not seeing what others are seeing" here. > I think “the wrong abstraction” is a confused way of referring to poorly-de-duplicated code. H
by karmakaze 3y ago
There's an aspect of "not seeing what others are seeing" here.
> I think “the wrong abstraction” is a confused way of referring to poorly-de-duplicated code. Here’s why. [...]
> So instead of “duplication is cheaper than the wrong abstraction”, I would say “duplication is cheaper than confusing code littered with conditional logic”. But I actually wouldn’t say that, because I don’t believe duplication is cheaper. I think it’s usually much more expensive.
It seems the author is considering 'cost' to be the mechanical effort of managing the sync/desync of the DRY code. What it's not considering is that distinct intents can incidentally use the same implementation at the moment. This is when it's not a good idea to DRY because there they are not meant to stay in sync.