Remix.run Logo
coldtea 2 hours ago

>A bad abstraction would at least have had one fire in one place.

On the contrary: that's precisely what a bad abstraction would not offer.

Instead it would spread its assumptions to different parts of the system, as every caller, sub-service, etc. would have to change shape to fit in that abstraction's box, however unnatural it is (and we know it would be unnatural, because we already said it's a bad abstraction).

Abstraction is not the same as encapsulation.

dofm 2 hours ago | parent [-]

> instead it would spread its assumptions to different parts of the system,

But so does duplication, in practice, and it diverges more as it does.

coldtea 2 hours ago | parent [-]

Duplication is just code doing the same thing in several places, and as such it's much easier to make DRY (and much easier after you have N copies to see what should be shared and what should not), compared to re-architecting the whole system to remove a bad abstraction.

cjfd an hour ago | parent [-]

No. The duplication is seldomly that clean. It has started to diverge in subtle ways where the question becomes whether that was the intention or not. In the worst possible cases it has resulted in 8000-line functions full of duplication. 're-architecting the whole system to remove a bad abstraction' sounds fear mongering. That never happens.

svieira an hour ago | parent [-]

Ah contraire, mon ami, I am currently in the process of doing just that in many places in my current codebase.