3 ms·
If you mean "why isn't everyone coding in CoffeeScript and compiling to Javascript," the answer is that not everyone sees the benefit in learning a new syntax t
by billybob 15y ago
If you mean "why isn't everyone coding in CoffeeScript and compiling to Javascript," the answer is that not everyone sees the benefit in learning a new syntax to write code they already know how to write in Javascript. "Prettier code" isn't compelling for everyone, and adding a layer of abstraction can generate its own problems.
You still have to debug your Coffeescript in Javascript, so you still have to understand Javascript. Unlike, say, HAML, where you can't possibly do anything in HAML that you wouldn't know how to do in HTML, Coffeescript lets you avoid learning about JS prototypes by using Coffeescript classes and letting it translate for you. You'd better hope the abstraction doesn't leak.
I'm not against Coffeescript - I'm excited to start using it soon. I'm just saying that I understand why not everyone is.
If you mean "why do we still have to compile to Javascript," well, we'll have to do that at LEAST until every browser supports Coffeescript natively (currently none do, so you're looking at maybe 2025 when IE9 falls out of use), and probably beyond that (since there's little chance that MS will break backwards compatability with JS).
- billybob 15y agoAnother reason might be toolchain. If you're coding in a Rails 3.1 application, Rails takes care of compiling your Coffeescript and SASS and such for you. If you're using a toolchain that doesn't do that for you, you have to set up watch scripts and decide where source and compilation go, etc etc. That headache has to be weighed against the perceived benefits.