This is where coding becomes more art than science. There's an intuition that comes to knowing when it's time to abstract something and when the ad hoc implementation is better. And I do mean better, not faster, or lazier, but better. The sense among moderately experienced developers seems to be that the abstraction is always better, but it really comes down to good sense.
They talk about concrete knobs and dials, bolted on in advance of actual requirements.
"Can do it all" isn't abstraction because it does not hide any details, doesn't abstract away anything.
So if we both have such a different take, please share which part of article motivated your comment so that we can compare in greater detail, if you please.
Honestly if your criticism to code reuse is all about DRY, and you equate code reuse with abstraction, then it should not be taken seriously.
Abstraction, code reuse and DRY are 3 different things. Abstraction is control, when you want the client code to conform to a pattern, so that it won't break your system. Code reuse can be either about convenience or control, can be abstraction related or not. For example when you reuse a function that perform a critical business logic, you don't do it to conform to an abstraction, nor to save time typing the function again. You do it because you want a single source of truth for that bit of logic.
3 comments
[ 2.4 ms ] story [ 20.0 ms ] threadThey talk about concrete knobs and dials, bolted on in advance of actual requirements.
"Can do it all" isn't abstraction because it does not hide any details, doesn't abstract away anything.
So if we both have such a different take, please share which part of article motivated your comment so that we can compare in greater detail, if you please.
Abstraction, code reuse and DRY are 3 different things. Abstraction is control, when you want the client code to conform to a pattern, so that it won't break your system. Code reuse can be either about convenience or control, can be abstraction related or not. For example when you reuse a function that perform a critical business logic, you don't do it to conform to an abstraction, nor to save time typing the function again. You do it because you want a single source of truth for that bit of logic.
Lastly DRY is purely about convenience.