foo -> bar 'foo', -> 'bar'
The point, is that Javascript is simple in demonstrating what are and aren't functions because it has an ending delimiter.CofeeScript isn't simple with anonymous function creation.
foo -> bar 'foo', -> 'bar'
The point, is that Javascript is simple in demonstrating what are and aren't functions because it has an ending delimiter.CofeeScript isn't simple with anonymous function creation.
foo -> bar 'foo', -> 'bar'
Means: foo(-> bar('foo', -> 'bar'))
But in any case, you wouldn't write it like that.The point is an ending delimiter would greatly benefit CoffeScript.
Although CofeeScript certainly has its perks, anonymous function creating isn't simple then Javascript.
> Telling the user to write something in two different ways,
> depending on the argument being passed, isn't simple.
Huh? Sure it is.Fun fact: Any algorithm you can write in JavaScript can also be written as a single function, full of nested whiles, if/elses, fors, labels and breaks ... does that mean you should write your entire program as a single function? Nope.
I'd like to think that CoffeeScript functions read better without an "ending delimiter":
$('button').click ->
alert "hello"
# Or:
app.get '/', (req, res) ->
res.send 'Hello World'
In any case, if you're interested in using CoffeeScript, but the lack of an ending delimiter is putting you off -- I encourage you to add one in your fork. app.get '/', (req,res) ->
res.send 'Hello World'
?There are horrible ways to write a lot of code, especially in whitespace based languages. What does petty comparisons like this bring to the argument?
Basically it would be a lot easier if a ending delimiter was the default for the language.