Hi Angus!

1) Kevin et al suggested YAGN call/apply on (non-method) functions. Here's
> a pretty neat example where call/apply is a perfect fit for standalone
> functions - and would break if replaced with fat arrows.
>
> https://gist.github.com/2520731
>

This is a great example.  Two points:

1.)  In this case, I think it's going to be pretty difficult to prove that
a "dynamic this" arrow function would be any more readable or "better" than
current syntax:

    // On what basis is this:
    this.initialize = () -> { ... };

    // any better than this?
    this.initialize = function() { ... };

There are a couple of characters saved, but it's less readable.  Why
introduce new syntax for such dubious gain?

2.) For mixin stuff like your example, I think the elegant solution is
"object literal extension" syntax:

    https://gist.github.com/2521128

I'm not sure of the status of that syntax, but hopefully it will get
included in ES6.

kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to