Good-bye constructor functions?

Brandon Benvie brandon at brandonbenvie.com
Mon Jan 7 15:31:22 PST 2013


I also agree with the sentiment. Splitting allocation from initialization
helps to clarify the two separate roles that constructors have
traditionally filled, and how a class could/should diverge from that. The
class itself is the thing that should allocate the new object, the
constructor initializes newly minted objects. Perhaps a middle ground with
the backward compatibility issue that awb mentions would be that calling a
class is always treated as constructing it, in that it always allocates a
new object if it's not receiving a newly created one from a subclass that's
in the process of initializing.


On Mon, Jan 7, 2013 at 6:24 PM, Brendan Eich <brendan at mozilla.com> wrote:

> Allen Wirfs-Brock wrote:
>
>> Even if we think we should discourage direct calls to class objects (I
>> think I'm now in that camp)
>>
>
> (Why so?)
>
> /be
>
> ______________________________**_________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130107/6a8c6b0a/attachment.html>


More information about the es-discuss mailing list