Hacker News new | ask | show | jobs
by fenwick67 3242 days ago
Classical inheritance is useful in JS sometimes, but I agree with the sentiment of "don't use it unless you have a reason to".
1 comments

Ya, that part I don't agree with. Especially since he also says to use ES6 features, which includes the new class syntax, making it a lot more straightforward to use classes + inheritance (even if it's still prototypical under the hood).
I suppose it could be considered more 'general' programming advice, not specific to JS. At least here on HN there seems to be a consensus that classical inheritance more than 1 layer deep is a bad idea (correct me if I'm wrong though, dear HN readers and writers!).

Personally I'm a huge functional programming weenie for no reason I can coherently defend, so I prefer to avoid ES6 classes. But quite often they end up being the most reasonable solution to my problem, and having syntax for it is great. I just avoid them by default.