Most people don't like hoisting -- and I agree that variable hoisting is crazy. I'd never advocate this:
a = 2;
var a;
But function hoisting I find super useful. I always prefer to write my files like this: foo();
bar();
// ....
function foo() { .. }
function bar() { .. }
...because when I open a file, I don't want to go hunting for any executable code, I just want to look at the very top. Function declaration hoisting lets me put those definitions at the bottom and the code that uses them at the top.I've found this to be much more useful in code maintenance.