Is class syntax really necessary ?
rfobic at gmail.com
Mon May 23 03:17:45 PDT 2011
I think there lot's of proposals for ES.next that require syntax extensions, which is probably worth if new functionality added or shortens most commonly used constructs like functions (were no other option is available). In case of this proposal: http://wiki.ecmascript.org/doku.php?id=strawman:classes_with_trait_composition#open_issues even though
I like it I'm not sure adding new syntax is worth it.
I'm not suggesting that sugar for class composition is not necessary, example from three.js used by proposal highlights necessity pretty very well, I'm just thinking of doing that without introducing new syntax, here is one option: https://gist.github.com/986487
This way syntax noise may be reduced in addition this can be shimmed into current JS by implementing `Function.prototype.extend`.
Also every single frameworks today does something similar in one form or another, IMO all is necessary is to have a standard that will let bikeshedding go away. I think there is also a good precedent of this with `Function.prototype.bind`.
Here are some related links:
Address: 29 Rue Saint-Georges, 75009 Paris, France
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss