5 ms·
JavaScript 2's new direction -- factional fight has been resolved
- IsaacSchlueter 18y agoOh thank heaven. Those of us who actually LIKE prototypal inheritance and functional scope won't have to deal with all that copycat java nonsense any time soon!
- marijn 18y agoArguably, there wasn't any copycat Java nonsense in ECMA 4. And even if there was any, it was all entirely optional. (And if you're allocating a huge number of x,y coordinate objects, it would be kind of nice to use specialised two-field objects rather than hash-tables, wouldn't it?)
- andreyf 18y agoThey aim to resolve XSS in the JS spec? Why not just restrict JS execution to some part of the HTML document that usually doesn't display user input?
- andreyf 18y agoNo, a downvote is not a valid answer...
- eterps 18y ago> Harmony could feature classes as a stronger way of making objects As opposed to what? The current prototypical object model? How can class based OOP be 'stronger'?
- DougBTX 18y agoHopefully it includes being able to define non-enumerable properties, such as writing your own array.length which won't appear in a foreach statement.
- gruseom 18y agoRead the whole sentence: "a stronger way of making objects and generators to enable powerful programming patterns". Don't you want to enable powerful programming patterns? :)
- richcollins 18y agoIt would be nice if they just fixed the current prototype based system instead.
- cbetz 18y agoWhat is broken about it? (edit: just saw the following comment: Non-enumerable properties would be very nice)
- richcollins 18y agoIt is overly complicated and there are a bunch of special cases. See Io's prototype system as a comparison: http://iolanguage.com/scm/git/checkout/Io/docs/IoGuide.html#Objects-Overview http://iolanguage.com/scm/git/checkout/Io/docs/IoGuide.html#...
- marijn 18y agoThe current object model is theoretically more powerful than class-based objects, but no one has found a way to implement it very efficiently yet. Thus, for performance, it would be nice to have a more static alternative. (Though I suppose they could have come up with a static prototypical system, rather than classes. Classes can be pretty nice though, when they are not Java/C++/C# classes.)
- cbetz 18y agoI read recently that Tracemonkey will have prototype "cache" of sorts that should speed up prototypical inheritance significantly.