4 ms·
Having spent a long time with Java I believe I understand the limits of this style of coding; in my considered opinion, composition is almost always better than
by javajosh 9y ago
Having spent a long time with Java I believe I understand the limits of this style of coding; in my considered opinion, composition is almost always better than inheritance. This is true regardless of the type of inheritance, be it prototypal or class-based (in appearance or reality). Therefore, adding features to JS to make class-like inheritance slightly better is not a trade-off I would make, favoring a simpler language over a feature who's use shouldn't be encouraged.
- always_good 9y agoThey're talking about this section in particular: https://github.com/tc39/proposal-unified-class-features#decorators https://github.com/tc39/proposal-unified-class-features#deco... Where decorators are sugar for higher order functions, even capable of `Class -> Class` transformation, which makes them much different from Java annotations.