Search

4/08/2014

Why the (CoffeeScript) arrow matters

Why the (CoffeeScript) arrow matters

BONUS POINTS: NO NAMED FUNCTIONS - NO CONFUSION An otherwise forgotten but very important feature on CoffeeScript is the absence of named functions. This is great, because named functions are available to all of your code regardless of the declaration order. This makes it very easy to write some really confusing JS code:
var importantThing = veryComplicatedFunction()

// (...) A thousand lines later

function veryComplicatedFunction () { ... }
This type of organization is very damaging to the readability of your code. CoffeeScript requires you to store functions in variables - like everything else.

沒有留言: