3 ms·
>Variable initialization and reassignment are the same It’s easy to accidentally overwrite a variable from a higher scope as a codebase increases in depth. Ye
by jasode 11y ago
>Variable initialization and reassignment are the same
It’s easy to accidentally overwrite a variable from a higher scope as a codebase increases in depth.
Yep. There was a previous July 2013 article and related reddit thread about it.[1] The CoffeeScript compiler devs themselves were bitten by their own strange scoping rules!
As to the other question about why people don't just write raw Javascript, Eric Lippert explained why plain Javascript is inadequate if you want to do more than just "make the monkey dance"[3] -- a.k.a. "large complex apps".
[1]https://www.reddit.com/comments/1j1cw7 https://www.reddit.com/comments/1j1cw7
[2]https://github.com/jashkenas/coffee-script/commit/7f1088054c91f5ab3bf1ea1098b6ebffaa29a5a9 https://github.com/jashkenas/coffee-script/commit/7f1088054c...
[3]http://programmers.stackexchange.com/a/221658 http://programmers.stackexchange.com/a/221658