An experiment using an object literal based class definition pattern
brendan at mozilla.com
Fri Aug 5 12:58:36 PDT 2011
On Aug 5, 2011, at 11:43 AM, Bob Nystrom wrote:
> Haven't we done that with ES1-3 already? Users have had 15 years of prototypes and what they chose to do was make classes. We've got Closure's goog.extends(), Dojo's dojo.declare(), Prototype's Class.create() (ironic, given the name of the framework!), JS.Class, and CoffeeScript's class syntax. How many more cows do we need before that path is ready for paving?
I agree with this. We just need to avoid false "agreement" on syntax that doesn't actually work (is not symmetric or strongly analogical), and that *is* usable. And of course we need to agree on semantics that are already in the language (internally or, with <| as Allen has proposed, in ES.next), specifically class-side inheritance.
Leaving things out can help, but it risks making too stunted a proposal. Adding too much is obviously bad, and Mark already took out the traits option.
Again, it seems to me the meta-problem with classes is that no one champion is actively working the syntax and semantics to reduce appropriately, user-test, and otherwise to resolve the open issues. So, are you able to spend time editing the proposal?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss