News for hackers. Stuff that matters.
Re:Why the (CoffeeScript) arrow matters by AdrianRossouw on Sunday March 30, 2014 @08:08PM (#7498603)
> arrow "keyword" a very sensitive choice

I think you meant 'sensible' there.

I actually find the cs arrows a lot more useful than the es6 short-hand function definition, because a lot of the time I want to do be able to do composition, and the es6 one always binds the scope to where it's defined.

I love named functions otherwise, which ease debugging and understandability. I actually don't care for implicit returns, not just because i prefer being explicit, but because it's the cause of some very weird bugs at times.

Re:Why the (CoffeeScript) arrow matters by gadr90 on Sunday March 30, 2014 @08:12PM (#7498621)
Thanks! Updated.

Didn't know that about the new ES6 functions. I'll check it out.

Yes, named functions do improve debugging... But I guess it's worth the trade. I have come across very confusing code thanks to named functions.

Re:Why the (CoffeeScript) arrow matters by dyladan on Sunday March 30, 2014 @08:51PM (#7498802)
Can someone please explain to me in a bit more detail what the advantage of not having named functions is?
Re:Why the (CoffeeScript) arrow matters by brianchu on Sunday March 30, 2014 @08:59PM (#7498833)
There's a difference between assigning an anonymous function to a variable and declaring a named function. It's the difference between:

    var funcName = function(){}
    function funcName(){}
The problem is that using named functions involves nuances that can be confusing. Generally it's considered idiomatic to just avoid named functions altogether. You can read about some of the nuances here: http://kangax.github.io/nfe/
Re:Why the (CoffeeScript) arrow matters by secoif on Sunday March 30, 2014 @09:25PM (#7498945)
> Generally it's considered idiomatic to just avoid named functions altogether.

This is not idiomatic. Many developers only use named functions.

The obvious reason is they make stack traces far more readable, though you can get around this by naming functions anyway:

  var myFunction = function myFunction() {}
The hoisting 'nuances' you decry are a boon. Hoisting means you never have to worry about the order functions are declared – especially useful in cases where your functions call each other. You also get another avenue to declutter your code by pushing any crufty utility functions to the bottom of the page.
Re:Why the (CoffeeScript) arrow matters by lowboy on Sunday March 30, 2014 @09:40PM (#7498990)
Named function expressions will cause memory leaks in IE < 9. Shouldn't be a problem forever, but some devs now might be impacted.

Pushing utility functions to the bottom of the current file is another reason to use a modular js architecture.

Re:Why the (CoffeeScript) arrow matters by function_seven on Monday March 31, 2014 @03:42AM (#7500184)
I read your link and found it to be very educational, but I don't believe it supports avoiding named function declarations, but rather named function expressions, since those are the source of inconsistencies between browsers.

My takeaway is that it is wise to avoid using named expressions, but fine to stick with anonymous function assignments, or declared functions. To add a third example to your list:

    var funcName = function(){};
    function funcName(){}
    var funcName = function funcName(){}; // <-- Danger!
Re:Why the (CoffeeScript) arrow matters by gadr90 on Sunday March 30, 2014 @09:02PM (#7498853)
Nice material! Thanks for sharing.
Re:Why the (CoffeeScript) arrow matters by mck- on Sunday March 30, 2014 @09:02PM (#7498856)
Re:Why the (CoffeeScript) arrow matters by joev_ on Sunday March 30, 2014 @09:52PM (#7499032)
There is no advantage. In fact, it's more annoying when you're debugging, since you don't get the fn name in the trace.