On dropping @names

David Herman dherman at mozilla.com
Mon Dec 3 17:42:21 PST 2012


On Dec 3, 2012, at 4:38 PM, Domenic Denicola <domenic at domenicdenicola.com> wrote:

> On the subject of ugly code, I believe the killing of @names and the reintroduction of computed properties means that the typical iterator form will be something like:
> 
> let iterable = { *[iterator]() { yield 5; } };
> 
> Presented without comment...

I'm sorry, but I reject this kind of argument. That code is simply more concise than:

    let iterable = { [iterator]: function*() { yield 5 } };

or:

    let iterable = {};
    iterable[iterator] = function*() { yield 5 };

So... concise code is concise -- film at 11. :) Sure, arranging ASCII symbols next to each other in ways you couldn't do before can be confusing. Remember what regular expressions looked like when you first learned them?

Dave



More information about the es-discuss mailing list