as your project gets big, does coffeescript help us write more maintainable code, better abstract our solutions so we can keep less things in our head at once, resulting in higher agility and fewer bugs? When you look at the deep reasons why a large codebase went sour, you're not blaming it on things like list comprehensions, you're blaming it on things like "Java strong-arms us towards building abstractions with only OOP, which over the course of a few years builds into indecipherable layers of implementation inheritance, causing high defect rates and much decreased agility".
The difference between CoffeeScript and Javascript, in terms of what a team can accomplish, hasn't been proven in production-scale projects. they may be, or maybe only for some teams, or maybe they aren't, but you can't debate something without being able to articulate the opponent's position.
update: interestingly, ClojureScript may be a language where the productivity delta from javascript is much larger, and is better worth it. clojurescript introduces new ideas and idioms to the js community, where coffeescript is an incremental update to javascript with no new ideas.
We had never used CoffeeScript before the project and we finished what you see today in about 6 weeks with a team of 3.
The project codebase looks like it was written with consistent style all the way through, which can be harder to do with JavaScript when it's 3am and all you want to do is make it work (when you start to get lazy). It was nice knowing that the for loops I was writing would compile to the same for loops that the other guys were writing.
CoffeeScript currently makes up just over 1% of Airbnb's codebase. I expect that number to grow quite a bit over the next year. Here's the breakdown according to github: http://cl.ly/2A241Z2d2I2m2R211Q1t
How much functionality, if you can make a guess, would you say is there in the codebase in cs?
Given how CS maps to JS, I'm not too worried about leaky abstractions.
so i certainly agree with this, but in my experience, as the problems get harder, my happiness isn't determined by syntax.
the things that make me mad are "i have to fix this defect but this code is a fragile mess which i'm afraid to touch, so i bandaid on more hacks to have the minimum possible area of impact so i know for certain that i can give this to the client and it won't make things worse". that makes me fucking furious, man, the artist in me dies a little bit every time I do it. We have this issue in our large javascript codebase. CoffeeScript would probably help a little bit, but a speculative 2x improvement in "fucking furious" is still furious.
This opinion is probably along the lines of those who think CoffeeScript is a toy. List comprehensions don't fix our problem; we (my team) just don't care. investing in education, growing the teams ability to craft well factored code and stable code, that will have exponential payoff.
Now you can get meta here and say a language like ClojureScript which brings Clojure's strong opinions about managing complexity and crafting good abstractions - you get better just by using it, its sort of self-educating. ClojureScript has my attention.
It may not be the best anti-CoffeeScript argument out there, but it is a pervasive one. The most common objection I've seen to using CoffeeScript is not any actual criticism of the language or of the various overhead created by another layer of abstraction, but simple horse laughs along the lines of "CoffeeScript is a toy. Use a real language."
While the stronger arguments should be addressed, like the one against against adding an additional abstraction, I don't think addressing the weaker arguments is "missing the point".
An awesome tool for helping you to learn Coffeescript is the "Try Coffeescript" tab on http://coffeescript.org/. This lets you type a little bit of stuff, and see how it translates into Javascript, in realtime, while you type. I still use this today when I'm trying to verify I'm on the right track with a bit of punctuation (meaning, leaving punctuation out, usually).
Note that although :CoffeeCompile operates on the whole file by default, it also works on buffer regions, so vai,c shows me the current block as JS (i is from indent-object plugin)
[0] http://esa-matti.suuronen.org/blog/2011/11/28/how-to-write-c...
This seems to come up often, the purported ugliness of JavaScript. To rebut, I'll use one of his own arguments:
I don't really know why people bring this up so often. It's just a non-problem for me.
It seems that the author is surprised by rational human behavior. A new language introduces a tradeoff between having a new tool that may better solve your problems, and introducing fragmentation where the developer must invest time learning a new language and tooling or the developer faces a smaller body of code that he can work on.
I like and use CS, but the author's philosophy that more languages in use always better for everyone, is fundamentally flawed.
http://commandcenter.blogspot.com/2011/12/esmereldas-imagina...
Then what is the meaning of [f 1] ?
EDIT: I've tried on http://coffeescript.org/ and it seems a = [1 2 3] doesn't work? EDIT2: newlines instead of spaces works, my bad
Apparently as a consequence of this ambiguity, even [f 1] has become illegal in Ruby 1.9. One of those god-awful undocumented changes that broke my apps. :(
However, I'm old enough to remember when JavaScript was first introduced as LiveScript and it was mostly seen as a toy for simple stuff while Java was the Real Deal. (I started my first company largely on this premise.) The big competition back then was ActiveX. Remember that? Amazing how things have evolved.