Sep 27 meeting notes

Bob Nystrom rnystrom at google.com
Fri Sep 30 13:07:58 PDT 2011


On Fri, Sep 30, 2011 at 12:59 PM, Axel Rauschmayer <axel at rauschma.de> wrote:

> I wholeheartedly agree with not obsessing about the token count. I’m very
> sensitive to context in this regard: in some contexts, I don’t mind or even
> welcome additional tokens, in other contexts I hate them.
>
> However, avoiding repeating the same identifier several times seems worth
> it to me (this kind of redundancy goes beyond dropping a token or using
> shorter tokens).
>

+1 to this. I don't think a shorthand for this is the most important part of
a class syntax, but it seems like a relatively easy win for a part of the
language that currently feels unnecessarily redundant.

- bob


>
> Java:
>    class Point {
>        public int x;
>        public int y;
>        public Point(int x, int y) {
>            this.x = x;
>            this.y = y;
>        }
>    }
>
> JavaScript:
>    class Point {
>        constructor(this.x, this.y) {
>        }
>    }
>
> Java is even more fun if you have getters and setters for x and y.
>
> --
> Dr. Axel Rauschmayer
>
> axel at rauschma.de
> twitter.com/rauschma
>
> home: rauschma.de
> blog: 2ality.com
>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110930/fdf2fd49/attachment.html>


More information about the es-discuss mailing list