1- Yes, several time that you mention it, and ++ from me each time

2- I prefer the dot notation rather than Object.extend, even if both are good

Le 28/04/2012 20:49, Kevin Smith a écrit :
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

--
jCore
Email :  [email protected]
Web :    www.jcore.fr
Webble : www.webble.it
Extract Widget Mobile : www.extractwidget.com
BlimpMe! : www.blimpme.com

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

Reply via email to