I cringed a bit when I saw this on the project page:
Class definitions closely resemble the familiar syntax of languages like Java and PHP
Why do people continue to try and shoehorn ‘classical’ inheritance into javascript? The implementation is almost always ugly. Why not just embrace the prototypical inheritance the language comes with?
Why not just embrace the prototypical inheritance the language comes with?
I lean in this direction too, but I can’t lie⦠I am really intrigued by this project.
Frameworks that adopt “classical” concepts have always left all the good stuff out. By that I mean abstraction, interfaces, finality, statics, constants, etc. This seems to be filling that gap better than my expectations lead me to believe. An optional new on constructors is pretty nice, too (however I believe it can enable bad habits).
So nobody is going to minify ease.js? Of course they will, it’d be silly not to. So I’m going to go to a website, click around for the link to the unminified js, download it and minify it myself, and then compare to the minified version they’re serving? At this point it seems a little too late. My browser is already running their code; any unpleasantries in it have already done whatever they’re going to do.
Super simple – you use Class.extend(...) to build a class, use the init key for constructors, use YourClass.extend() with the same syntax for inheritance, and you use this._super to get a “super object” for calling superclass methods. Very little to remember, tiny to embed, and It Just Works.
I cringed a bit when I saw this on the project page:
Why do people continue to try and shoehorn ‘classical’ inheritance into javascript? The implementation is almost always ugly. Why not just embrace the prototypical inheritance the language comes with?
umm, and by ‘prototypical,’ I of course mean ‘prototypal’
I lean in this direction too, but I can’t lie⦠I am really intrigued by this project.
Frameworks that adopt “classical” concepts have always left all the good stuff out. By that I mean abstraction, interfaces, finality, statics, constants, etc. This seems to be filling that gap better than my expectations lead me to believe. An optional
newon constructors is pretty nice, too (however I believe it can enable bad habits).By reading it?
Reading obfuscated/minified JS is not the easiest thing to do.
So nobody is going to minify ease.js? Of course they will, it’d be silly not to. So I’m going to go to a website, click around for the link to the unminified js, download it and minify it myself, and then compare to the minified version they’re serving? At this point it seems a little too late. My browser is already running their code; any unpleasantries in it have already done whatever they’re going to do.
IMO, the best “lightweight” classical JS library was whipped together by John Resig a long time ago.
http://ejohn.org/blog/simple-javascript-inheritance/
Super simple – you use
Class.extend(...)to build a class, use theinitkey for constructors, useYourClass.extend()with the same syntax for inheritance, and you usethis._superto get a “super object” for calling superclass methods. Very little to remember, tiny to embed, and It Just Works.