r/javascript • u/st23am • Nov 16 '12
A Case for Coffeescript
http://blog.gaslight.co/post/35845656900/a-case-for-coffeescript
1
Upvotes
7
1
u/hajamieli Nov 17 '12
I have direct CoffeeScript support in my framework. Compiles and packages changed files on the fly, also reloads all connected browsers, when ready.
-2
u/dougalcorn Nov 16 '12
Coffeescript pretty much sells itself after a few days of real world usage.
-6
u/polyrhythmic Nov 17 '12
Yep. You either get it and are making money faster or you're holding onto old JS conventions for the sake of tradition. The FP tools in Coffee are invaluable. I only wish I had switched sooner.
On top of that, Iced CoffeeScript is even better than plain. Serious life-changing dev experience.
22
u/rhysbrettbowen Nov 16 '12
A couple of things, when would you ever write:
function({}) ? - I'm guessing you mean function() {}.
and why write:
var that = this
when you can bind a function?
I actually think javascript is a beautiful language and coffeescript is uglier. Javascript has less symbols to learn (no @ for this and no -> or =>). Also you know that parenthesis and semi colons are required (or at least you have it in a style guide that they are). In coffeescript people can just drop parenthesis which makes things harder to read. I like having a parenthesis rather than whitepaces as I can scane for them to know a function is starting. That's what I call beautiful, the ability to know you're looking for one thing, not one of several.
I don't think beauty or readability is a case for coffeescript, if you're making a case then talk about the good things it does bring (you mentioned not putting in var which I like) but also comprehensions, splats , the existential operator and string interpolation.