Hacker News new | ask | show | jobs
by XCabbage 2674 days ago
Why? Old-school pre-ES6 explicit prototype wrangling was confusing, but what's wrong with using inheritance if you're writing in TypeScript (or, for that matter, a JavaScript version with classes)?
2 comments

Too much abstraction can be bad as well, many times I’ve written a nice class diagram to discover no one really needed to reuse certain functionality, a function would have sufficed :P
This article captures a few good reasons as to why composition is much preferred over inheritance:

https://medium.com/javascript-scene/a-simple-challenge-to-cl...