News for hackers. Stuff that matters.
Re:Jeremy Ashkenas's proposal for minimalist JS classes by ilaksh on Tuesday November 01, 2011 @03:58AM (#3181099)
I don't understand why we are still using JavaScript at all now that we have CoffeeScript.

Seriously, can someone please explain this to me?

Re:Jeremy Ashkenas's proposal for minimalist JS classes by billybob on Tuesday November 01, 2011 @09:01AM (#3181758)
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).

Re:Jeremy Ashkenas's proposal for minimalist JS classes by billybob on Tuesday November 01, 2011 @09:06AM (#3181779)
Another 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.
Re:Jeremy Ashkenas's proposal for minimalist JS classes by jpeterson on Tuesday November 01, 2011 @08:55AM (#3181740)
I can think of a few reasons:

* Some of us are actually comfortable with and enjoy programming in JavaScript. :)

* Are we absolutely sure as of now that adding the CoffeeScript abstraction will not introduce performance regressions and/or subtle bugs?

* Are the niceties and syntactic sugar of CS really worth the time I'll have to invest in mastering it? Or is this just another programming fad that everyone finds "cool" this month?

Re:Jeremy Ashkenas's proposal for minimalist JS classes by mmahemoff on Tuesday November 01, 2011 @04:13AM (#3181128)
A lot of CoffeeScript ideas are going into the next version of the JavaScript standard. Having "JS++" languages like CS around is a good way to inform the standards process, but the browsers should all be supporting some common standard, and that happens to be JavaScript.
Re:Jeremy Ashkenas's proposal for minimalist JS classes by ilaksh on Tuesday November 01, 2011 @05:07AM (#3181244)
CoffeeScript is compiled into JavaScript both on the server and on the client.

Yeah, I know he didn't try to sell CoffeeScript on the client, but that isn't because its not better to use CoffeeScript on the client, its just because its not worth trying to sell to people if you are trying to get them into CoffeeScript. Sure it might be a bit harder to debug on the client, but not as hard as looking at a pile of JS.