I made an example here: http://pastebin.com/2nS9EDPb
(Please correct me if I'm wrong, I wasn't aware for example that function declarations were treated as variables, redefinable etc)
250 karma · joined October 26, 2013
I made an example here: http://pastebin.com/2nS9EDPb
(Please correct me if I'm wrong, I wasn't aware for example that function declarations were treated as variables, redefinable etc)
What I'm still arguing for is that "enforcing semicolon habits" is not a compelling argument for using function expressions over function declarations. (Perhaps you're talking about semicolons in general, which is something I would rather not get into :)
I'm really skeptical about this. Using function expressions has some quite subtle consequences (hoisting, accidental/unintended closures) which you automatically avoid when using function declarations. Function declarations are also very useful since they allow you to use the function before it is defined (in the code), which mean you can read the code (and use the function name as an abstraction) without having to scroll past all function implementations.
To expand a bit on the accidental closures part, a variable bound by a closure is an implicit dependency of that function. By breaking function expressions out as function declarations you can be more explicit about what kind of input that piece of code needs from the outside. I just think overuse (nesting etc.) of closures can lead to some quite messy code, it gets harder to reason about when a variable was actually bound and to what.
Everyone here knows that it's not "free" but subsidised by taxes. That's what "free" means when talking about healthcare, free at the point of service, and free as equally available to everyone.
How else would it work? Are the doctors without pay and with no equipment?