Re:I don’t buy “duplication is cheaper than the wrong abstra...
by jrumbut on Tuesday August 29, 2023 @02:32PM
(#37311933)
I think the key here is the oft repeated but often poorly understood maxim to favor composition ("has a") over inheritance ("is a").
If you have a mixin (or other means of composition) that you use in several places and one diverges, it's easy to remove it. If you use inheritance, it's going to be more painful.
A language that offers OOP via prototypes instead of classes like JS can (sometimes) give you the best of both worlds, but it will confuse a lot of devs who aren't familiar with that kind of OO design.
If you have a mixin (or other means of composition) that you use in several places and one diverges, it's easy to remove it. If you use inheritance, it's going to be more painful.
A language that offers OOP via prototypes instead of classes like JS can (sometimes) give you the best of both worlds, but it will confuse a lot of devs who aren't familiar with that kind of OO design.