3 ms·
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 ot
by jrumbut 3y ago
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.