3 ms·
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
by XCabbage 8y 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)?
- deleted 8y ago[deleted]
- seattle_spring 8y agoThis article captures a few good reasons as to why composition is much preferred over inheritance: https://medium.com/javascript-scene/a-simple-challenge-to-classical-inheritance-fans-e78c2cf5eead https://medium.com/javascript-scene/a-simple-challenge-to-cl...
- perrohunter 8y agoToo 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