News for hackers. Stuff that matters.
Re:Dropbox dives into CoffeeScript by pooriaazimi on Thursday September 13, 2012 @06:45PM (#4519055)
Why and how could function hoisting be useful?

(Genuine question, not an snarky comment)

Edit: Huh! I thought you meant "variable hoisting", which is the most evil language feature that's ever bitten me!

This is an introduction to "function hoisting": http://elegantcode.com/2011/03/24/basic-javascript-part-12-f... - Very very interesting.

Re:Dropbox dives into CoffeeScript by jarek-foksa on Friday September 14, 2012 @03:45AM (#4520611)
I always felt that function hoisting is harming code readability. I prefer reading the code from top to bottom, I don't want to stuble upon functions that were not declared before.

If I recall correctly the main reason why this feature is not supported by CoffeeScript is because of some awkward IE bug though.

Re:Dropbox dives into CoffeeScript by jashkenas on Friday September 14, 2012 @07:48AM (#4521145)
The main reason is what you say -- it harms readability. Much better to have functions behave like any other value, like any other variable -- and only be usable after they've been created.
Re:Dropbox dives into CoffeeScript by tripzilch on Thursday September 20, 2012 @05:07PM (#4550696)
I agree, although I also see some usefulness:

If your inner function names are sufficiently descriptive, you can write the high-level behaviour of the outer function at the top, first to be read, to get a quick overview of what it does. Then declare the inner functions below that (this also requires that the inner functions must not have surprising side-effects).

I've never seen or tried out code like that in practice, but it seems like it could work.