3 ms·
>duplication is far cheaper than the wrong abstraction Isn't that a pretty useless sentence? Of course duplication is cheaper because aren't the higher costs o
by croes 4y ago
>duplication is far cheaper than the wrong abstraction
Isn't that a pretty useless sentence?
Of course duplication is cheaper because aren't the higher costs one of the reasons why it's a wrong abstraction?
Reminds of this sketch from Fry and Laurie
https://youtu.be/XewVicFzRxw https://youtu.be/XewVicFzRxw
>Hugh: Yes but too much is bad for you.
> Stephen: Well of course too much is bad for you, that's what "too much" means you blithering twat. If you had too much water it would be bad for you, wouldn't it? "Too much" precisely means that quantity which is excessive, that's what it means. Could you ever say "too much water is good for you"? I mean if it's too much it's too much. Too much of anything is too much. Obviously. Jesus.
- jakelazaroff 4y agoDuplication and abstraction aren’t the same, though. Abstraction is a tool for reducing duplication. The point of the post is that if the abstraction is wrong, it’s worse than just leaving the seemingly duplicated code.
- croes 4y agoOf course because the higher costs are what make the abstraction wrong in the first place. That's like saying don't do the wrong thing.
- jakelazaroff 4y agoOh I see what you’re saying. No, “the wrong abstraction” doesn’t intrinsically mean it’s more costly than duplicated code. A lot of people argue that the wrong abstraction is still better than having duplicated code. She’s saying that’s not the case.
- williamcotton 4y agoExactly, the Church of DRY. Heathens! The truth is found in the Church of the Rule of Three. ;)
- yxhuvud 4y agoI'd disagree. An abstraction is a way to reason about a problem. Often that reduces duplication, but it is a side effect from a better understanding of the problem.