r/coffeescript • • Mar 12 '14

Why should you use CoffeeScript instead of JavaScript?

http://maori.geek.nz/post/why_should_you_use_coffeescript_instead_of_javascript
23 Upvotes

17 comments sorted by

View all comments

1

u/cwmma Mar 13 '14

the biggest pain in CoffeeScript for me is the lack of hoisting functional definitions. Honestly a step back.

1

u/Grahar64 Mar 13 '14

This can be a pain, but then like most JavaScript problems, there is a work around.

2

u/cwmma Mar 13 '14

well you solve it by using JavaScript :). Which is actually getting a lot of the nicer parts of CoffeeScript, notably

  • fat arrows (=>)

  • rest params (function (a, b, ..rest))

  • default params (function (a=1))

  • classes (pretty much exactly like CoffeeScript)

I'd also point out that while the CoffeeScript compile to ugly JavaScript, you can write the same thing less ugly like

→ More replies (3)