| Some thoughts: Given a sufficiently flexible and late-bound class system (like Smalltalk's), the differences between prototypes and classes can blur. But in general I would say that it is easier to build classes on top of prototype systems than vice versa, which is one argument for prototypes. All prototype implementations aren't the same, though, any more than Smalltalk and C++ both have the same class systems! Javascript and Self are quite different in some ways, especially when it comes to delegation (ie inheritance) and iolanguage and research such as Kevo are different again. Despite the first answer to the linked question, I don't think that either class based or prototype based languages are easier to write a VM for. What attracts me most is that prototype systems are conceptually simpler in an Occam's Razor sort of way. Instead of needing two concepts: classes and instances, we only need one: objects. |
That's true, but I find you end up having to make the difference. Yes, prototype inheritance is conceptually simpler but in practice it's more complex. In JavaScript, for example, OO code tends to be harder to follow and includes more boilerplate code. You have to make up for the simplicity of the platform in order to get your work done. In more traditional OO languages, inheritance might be more limited but it's also more straight forward and easier to implement, calling parent class methods is build in, and the "this" reference works consistently.