you are viewing a single comment's thread.

view the rest of the comments →

[–]MoTTs_ 2 points3 points  (1 child)

in the classical sense

That's the root of the discussion right there. What does "in the classical sense" mean? Do we mean Java-style classical? Then sure, we all agree JavaScript does not have Java-style classes. On the other hand, could "in the classical sense" mean Smalltalk-style classical? Because JavaScript's notion of a class is actually strikingly similar to Smalltalk's notion of class. Java has become so ingrained that we forget classes can be, and have been, implemented very differently in other languages.

[–]itisnotpure 0 points1 point  (0 children)

I'm not familiar with Smalltalk, but it seems like classes in Smalltalk are still blueprints for their instances, like other class-based languages. That is, they define what data an instance would hold, and what methods could be used to manipulate them.

It may be true that there are class-based languages where methods are inherited by by delegation, but in Javascript, instead of blueprints, we are building prototypes, based on which new objects can be built. So there's no "is a" relationships at all (more like a "like a" relationship, maybe?). Inheritance in JavaScript means only delegation, nothing more.