4 ms·
That were just examples. While this is often considered to be one of JavaScript's weaknesses, the prototypal inheritance model is in fact more powerful than th
by frik 12y ago
That were just examples.
While this is often considered to be one of JavaScript's weaknesses, the prototypal inheritance model is in fact more powerful than the class based model. It is, for example, fairly trivial to build a class based model on top of a prototypal model, while the other way around is a far more difficult task.
> The capabilities of the Smalltalk environments are simply on a different plane.
Please explain. Maybe use the following examples: FirefoxOS and Squeak
- discreteevent 12y ago” the prototypal inheritance model is in fact more powerful than the class based model. It is, for example, fairly trivial to build a class based model on top of a prototypal model, while the other way around is a far more difficult task” This is precisely what Kay is arguing against in his second point. In Smalltalk everything is an object including classes but there is a sharp distinction between a class and other objects and it's very important to make this distinction. It's important to be explicit about which level you are operating on. In general arguments about one thing being better than another because you can express one in terms of another don't hold up. Then you can argue that assembly is the most powerful of all. (see also the definition of Turing Tar Pit)
- frik 12y agoNot really. Your first paragraph is also true for JS (think of ES6 "class" syntactic sugar). Some browsers implement the DOM in JavaScript (https://www.chromium.org/blink/blink-in-js https://www.chromium.org/blink/blink-in-js, http://www.phantomjs.org/ http://www.phantomjs.org/, https://github.com/andreasgal/dom.js https://github.com/andreasgal/dom.js). And there are things like asm.js and even Linux VM running in JavaScript (http://bellard.org/jslinux/ http://bellard.org/jslinux/). JavaScript/ECMAScript is one of the most misunderstood languages, please read up before jump at conclusions.
- riffraff 12y ago> It is, for example, fairly trivial to build a class based model on top of a prototypal model, while the other way around is a far more difficult task. not in languages where you can control method dispatch and object allocation (smalltalk, ruby, python etc), than it's quite trivial.