I noted some open issues on "Classes with Trait Composition"

Mark S. Miller erights at google.com
Wed May 18 18:31:54 PDT 2011


On Wed, May 18, 2011 at 6:29 PM, Brendan Eich <brendan at mozilla.com> wrote:

> On May 18, 2011, at 5:57 PM, Bob Nystrom wrote:
>
> class Point {
>   public x = 0, y = 0;
> }
>
> let p = new Point();
> p.x; // 0
>
>
> This is pretty rare, in my experience. A hard case? If the constructor does
> set x and y from parameters, then you have double-initialization. If some
> properties are non-writable, you can't do this. YAGNI?
>

+1. If you're gonna initialize them somewhere, why not always do so in the
constructor and avoid special cases?



>
> /be
>
>


-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110518/5a5b9582/attachment.html>


More information about the es-discuss mailing list