Created
February 17, 2014 18:04
-
-
Save Spaceghost/9055820 to your computer and use it in GitHub Desktop.
Why I hate Coffeescript.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = undefined # var a; | |
a = "lol" # a = 'lol'; | |
rawr = (-> # rawr = function() { | |
a = "wat" # var a = 'wat'; | |
a # return a; | |
).call() # }.call(); | |
console.log a # console.log(a); | |
# returns 'wat' # returns 'lol' | |
# What the fucking fuck, Coffeescript... |
@ajmurmann, it's showing that coffeescript doesn't use var within function definitions. They don't like var.
// Generated by CoffeeScript 1.7.1
(function() {
var a, rawr;
a = void 0;
a = "lol";
rawr = (function() {
a = "wat";
return a;
}).call();
console.log(a);
}).call(this);
// Generated by CoffeeScript 1.7.1 with --bare
var a, rawr;
a = void 0;
a = "lol";
rawr = (function() {
a = "wat";
return a;
}).call();
console.log(a);
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wait, I am totally confused. Do I see this right that with "returns" you mean that that's what the console.log prints not what the return value of
rawr
would be if called? If that's the case then the coffee version makes absolutely no sense. Not only did they break variable scope, but also method invocation/definition. It's so broken, I am not even sure what they broke.