True. A method automatically does the right thing where it matters, anyway.

It’s nice to see the two concerns instantiation and initialization separated 
with the new() method. IIRC, the problem with subclassing Date is that it 
doesn’t separate them(?) If I’m right, an init() method would solve the 
problem. If not, can I read up on what the problem is?

Thanks!

Axel


On Nov 19, 2011, at 19:33 , Allen Wirfs-Brock wrote:

> 
> On Nov 19, 2011, at 9:54 AM, Axel Rauschmayer wrote:
> 
>>> 
>> 
>> I like the idea of replacing the method name “constructor” with something 
>> better, but “new” suggests instantiation *and* initialization to me. Is 
>> “init” a possibility?
> 
> Is that distinction between instantiation and initialization very important 
> for the average JS programmer (or stated another way, is the average JS 
> programmer at risk if they fail to understand that distinction).  Is the 
> sophisticated JS programmer who understand the difference between 
> instantiation and initialization and the detailed semantics of the new 
> operator going to get confused it the initialization code is labeled with 
> "new"?
> 
> My intuition in both cases is that the answer is no.  If I'm correct then 
> "new" seems like the better alternative.
> 
> Allen

-- 
Dr. Axel Rauschmayer
a...@rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



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

Reply via email to