3 ms·
Common Misconceptions About Inheritance in JavaScript
- jack9 12y agoA few bits of misinformation. > Is There a Big Performance Difference Between Classical and Prototypal Inheritance? Yes (but not the way the writer is trying to imply). Performance as a metric of code production per dollar spent. The amount of time and effort traded for prototypical models that are trying to mimic classical models, is a nontrivial penalty to this day. > Isn’t Classical Inheritance More Idiomatic than Prototypal Inheritance? Saying that javascript prototypical inheritance is just as idiomatic (or more) than a classical inheritance that JS doesn't support natively, is disingenuous. Putting a gigantic NO... in the article, doesn't change the fact that classes are the idiomatic way to do inheritance (ie CLASSICAL) and javascript was not designed to use that. > Prototypal OO is simpler, more flexible, and a lot less error prone. Dropped without the slightest bit of proof. At least he shills his products at the end for proper perspective.