Sunday nitpickery: class-based vs prototype-based OO

This Wikipedia article on ActionScript claims:

"Two important features of ActionScript that distinguish it from later versions are its loose type system and its reliance on prototype-based inheritance. [...] Prototype-based inheritance is the ActionScript 1.0 mechanism for code reuse and object-oriented programming. Instead of a class keyword that defines common characteristics of a class, ActionScript 1.0 uses a special object that serves as a "prototype" for a class of objects. All common characteristics of a class are defined in the class's prototype object and every instance of that class contains a link to that prototype object."

and (emphasis mine):

"[...] ActionScript 2.0 featured compile-time type checking and class-based syntax, such as the keywords class and extends. (While this allowed for a more flexible object-oriented programming approach, the code would still be compiled to ActionScript 1.0 bytecode, allowing it to be used on the preceding Flash Player 6 as well. In other words, the class-based inheritance syntax was a layer on top of the existing prototype-based system.)"

I'm not getting that. Prototype-based OO is, by its very nature, more flexible than class-based. It doesn't even matter if the class-based OO flavor has bells and whistles like metaclasses, multiple inheritance, class methods, or whatever. All of these become redundant with prototype-based OO. So how can they claim that the addition of class-based syntax allows for "a more flexible object-oriented approach"? Maybe I'm being pedantic here, but that just makes no sense to me at all.

(It appears that the most widely used prototype-based OO language is Javascript. I am aware that its version of OO is often regarded as a hack, but it *is* still more flexible than OO in, say, Java. (And probably Python and Ruby as well, although I haven't played enough with Javascript to make a bold claim like that. :-) For an example of what a real prototype-based system can do, see Io.)

Of course it's possible that I misunderstand this, or that AS1's version of prototype-based OO was so crippled that the class-based successor actually was an improvement over the old situation. I am currently looking into how AS3 handles all this. As far as I can tell right now, there is still some prototype-like stuff left. ^_^

:: Comments (5)