4 ms·
It's much closer to ActionScript and ES4 than to ES5 or ES6/2015/Next/Harmony/Trickshot.LegitScript/whatever the latest ECMAScript standard is. The main differe
by PeCaN 11y ago
It's much closer to ActionScript and ES4 than to ES5 or ES6/2015/Next/Harmony/Trickshot.LegitScript/whatever the latest ECMAScript standard is. The main difference is probably decent macro support.
There's always the Cookbook (http://code.haxe.org/category/beginner/index.html http://code.haxe.org/category/beginner/index.html) if you want to see for yourself.
- jdonaldson 11y agoOff the top of my head, Haxe has: block level scoping (vs. function level scoping) classic inheritance (vs. prototypes) distinction between hash and object (vs. nope) required semicolons (vs. still uncertain on that after 10 years) There's also the whole raft of static typing features, but there's too many of those to mention.
- carussell 11y agoES has all of those things except for requiring that a statement ends with a semicolon.
- Widdershin 11y agoI would disagree that ES has classical inheritance. ES6 has syntactic sugar over prototypical inheritance that resembles classical inheritance in other languages, but it's still prototypical under the hood.
- colbyAFTrustedK 11y agoIs there a meaningful ? I.e., what does classical inheritance get you that prototypes-under-the-hood don't? For a programmer using classes, that ES's are implemented using prototypes should be as important has how the JVM works.
- robocat 11y agoClassical inheritance enforces that a method can only be overridden by another method in a subclass. Prototypical "inheritance" allows different types of values to be assigned to the same symbol. E.g. if you have a method bob() on a prototype, you can set object.bob = 'astring'; and it isn't an error.
- colbyAFTrustedK 11y agoThat has more to do with a language opting out of having fixed types than it does with class-based versus prototype-based inheritance.