From github:
CoffeeScript:
number = -42 if opposite
Javascript:
if (opposite) number = -42;
How is coffeescript an advantage in this example? The javascript seems more readable to me as it more closely follows regular english grammar.
CoffeeScript:
square = (x) -> x * x
Javascript:
square = function(x) {
return x * x;
}
In this example, again the javascript seems more clear. The function actually has the word function in the declaration. I like that. Essentially coffeescript took out the word 'function' and 'return' and replaced curly braces with other symbols.
Inline conditionals on the left and the function keyword? From all the features that CoffeeScript offers it's kinda odd to focus on those minor details of taste and habit.
You can write it either way in CS. Anyway, saying that CS is a huge improvement over JS doesn't imply that every single feature of CS is better than its JS counterpart.
Javascript: if (opposite) number = -42;
How is coffeescript an advantage in this example? The javascript seems more readable to me as it more closely follows regular english grammar.
CoffeeScript: square = (x) -> x * x
Javascript: square = function(x) { return x * x; }
In this example, again the javascript seems more clear. The function actually has the word function in the declaration. I like that. Essentially coffeescript took out the word 'function' and 'return' and replaced curly braces with other symbols.