3 ms·
> 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 algor
by jashkenas 15y ago
> 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.
- fooandbarify 15y agoJeremy, I don't know much about CoffeeScript but I'm having a really hard time parsing your last example. Did you mean app.get '/', (req,res) -> res.send 'Hello World' ?
- jashkenas 15y agoI did indeed. Serves me right for commenting on the run.