Minimalist (why) classes ?

Brendan Eich brendan at mozilla.com
Mon Nov 14 12:23:30 PST 2011


On Nov 14, 2011, at 12:16 PM, Rick Waldron wrote:

> You keep bringing in various extend alternatives, but these are separate from classes. Yes, even in the case when the class body is non-empty: in that event the elements define properties on the new class prototype object, which shadow any properties on the base class prototype object. Shadow, not copy.
> 
> Apologies if I was unclear; I was originally responding to you...
> 
> "Let's argue about specifics or we'll get nowhere. Do you think Irakli's selfish.js extend (https://github.com/Gozala/selfish/blob/master/selfish.js) is the way to go, or Prototype's quite different form?

I did write that, and the specifics help (it's es-discuss), even when they go into a tangent or separate issue. But Irakli's message about inheritance via prototype wiring got me thinking that the crucial issue for classes (right now) is not composition, but prototypal inheritance.

The super issue was handled separately but works in classes. But apart from <| and some manual subcass-prototype construction and .constructor setting, we don't have a primitive for class inheritance as prototypal delegation -- that is, not one other than minimal classes.

Again I'm not saying the issue John wants to hash out (which is hydra-headed) is "unimportant" or anything like that. Indeed some of us (Alex, Dave, Brendan, Allen) think Traits are excellent. But do they need syntax, or just de-jure codification as built-in library code after de-facto standardization? I think the latter.

Remember, traitsjs.org is rather freeze-gun happy (Dr. Freeze!) and when it was proposed way back in March 2010 to TC39, we talked about less frosty alternatives.

/be

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111114/d5597afc/attachment-0001.html>


More information about the es-discuss mailing list