On Oct 31, 2011, at 10:45 AM, John J Barton wrote:

> On Mon, Oct 31, 2011 at 10:01 AM, Brendan Eich <bren...@mozilla.com> wrote:
>> On Oct 31, 2011, at 9:45 AM, John J Barton wrote:
>> 
>>> In my opinion for new syntax to support classical inheritance should 1) 
>>> target beginners and 2) help avoid the need for F.prototype/new F() pattern 
>>> for simple inheritance.
>> 
>> John, I almost-completely agree with you (yay!), except for the |new F| 
>> objection. What's wrong with operator new for class instantiation?
> 
> I don't object to "operator new" for creating instances.

Great.


> (It is more
> wordy in definition than a function property "new", a minor point).

(Do you mean 'constructor' is a longer word than 'new'? Not sure what the 
parenthetical is getting at.)


> My objection is the specification of methods on the |.prototype|
> property of the right-hand side operand of "operator new". I
> understand that it makes some logical sense,

It's how JS works, that's all. Agree it should be considered plumbing to be put 
behind a pretty cabinet door for n00b/classy programmers.


> Immediately after this phase the class-based language pattern leads
> you to think you are accomplishing great things, but mostly you are
> focusing premature on abstraction details.

That seems like a problem in itself. Maybe we can't solve it, and we're better 
off adding classes. But I've seen that over and over too. It gives me pause 
about class as the best or one true way.


> But that critical phase
> from "given an object |E|" to declaring |F| provides a big advantage.

Agreed.


> I believe this is why devs gravitate to selfish and extends() models.

Or bounce off JS.

/be
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to