Github: CoffeeScript cracks the top 10 languages
github.com
github.com
Source: https://twitter.com/joshpeek/status/205783659830198273
I'm in the process of ripping the last bit of coffeescript out of our code. The marginal benefits of the language don't exceed the costs of having another build dependency, and another syntax to understand. For daily work, I already have to switch contexts between Javascript, CSS, SCSS, HTML, rHTML, HAML and Ruby (not to mention other tools like Bash, Rake, etc., along with API knowledge like the Rails API, jQuery, and all of the various un- or poorly-documented gems). Ultimately, it's a huge mental burden. Every new thing is a new thing that someone has to understand to be productive.
To justify the extra mental cost of another piece of technology, it has to do something pretty amazing. A minor syntactical transformation of javascript just doesn't cut it.
The place it best fits in right now is for in-house software development at a place with a low turnover of developers. 37signals has a very low turnover, so it shouldn't be surprising that it fits them well. That mental burden is low, compared with the time saved using it.
Ehh....I think you're overstating it, but to each their own. To make the comparison fair, you'd have to turn it into something more obtrusive: it's like going from a 19" monitor to a 20" monitor that's driven by one of those $300 USB video cards that gets really hot and eats up desk space and might occasionally cause RFI problems with my wireless mouse.
Or more directly, it's like going from Ruby to Python, or vice-versa, by using a tool that converts one to the other. They're different, and they have different syntactical features, but the annoyances of either language balance the benefits to the extent that I can't confidently exclaim that one is better. And the auto-generation step would just cause pain.
The critical difference here is that to use coffeescript, I have to add another (IMNSHO) annoying step to my build process. Another layer of indirection to obfuscate bugs. Another sprocket that can come unglued and bork my app at any time. No thanks. I'll stick with my current complexity level, and write my list comprehensions as loops.
And as for "obtrusive," I guess that's just subjective.
On topic, your main problem is that you're playing the one man army with too many tools, that is obviously unrelated to CS or any language.
It's likely you wouldn't mind the additional complexity if you were only working on front-end.
Don't you mean Ruby?
If every CoffeScript program shared the same AST as its generated JavaScript program, i.e. if only the parse tree representing the concrete syntax differed, then your statement would be true.
However, that is not the case. The abstract syntax of CoffeeScript differs significantly from JavaScript, for example in CoffeeScript almost every statement is also an expression, which is not the case in JavaScript.
But this time I'll wait for something like Dart.
pop[lang] = avg(loc(proj, lang) / loc(proj) for proj in projects)https://github.com/CM7-GB/android_device_motorola_droid2we
Note the language breakdown, under the Graphs tab.
But yes, it all hinges on how Github measures popularity. For one, I'm curious how forked repositories are counted; if I have a 100kloc Blub project and it gets forked 100 times, does Github count that as 100,000 or 10,000,000 lines of Blub?
Of course, I think it's fair to say that there's more Obj-C code than CoffeeScript being written, but less of it is being open-sourced.
There's a huge contingent of…uh…let's just say "differently educated" developers who previously were making some delicious pasta in PHP and now want to build iPhone apps because they heard there's gold in them thar hills.
Objective-C is also a lower-level language than CoffeeScript and thus harder to use, especially if you're not used to working in a language where it's possible to free memory early or smash the stack.
So CoffeeScript is a very easy language that tends to be used by developers who are experienced in its domain, while Objective-C is a relatively hard language that has gotten a huge influx of rank amateurs in Stack Overflow's lifetime. Thus, the latter gets a disproportionate number of questions.
(For credibility's sake: I'm one of the top contributors to the Objective-C tag on Stack Overflow.)
I can't believe I'm reading an argument favoring Obj-C over (any flavor of) js as a noob turf...
The simple reason there's disparity is that github is not the center of the world and objC people mostly code for money, that's all there is to it.
I don't think this says much about CoffeeScript, which I use. However I do think it says quite a bit about how GitHub has plenty of room to grow as they make themselves more attractive to a broader market.
A very interesting chart would be GitHub account revenue broken down by file extension. Note that I didn't say language, as the real money is in assets, not code.
Edit: It does add features like pattern matching and list comprehension, and anything can compile down to js, so I guess it is a separate language.
Let me put it another way. If I were to write a separate runtime that directly executed CoffeeScript (without JS as an intermediate step), would you then be satisfied that it is in fact a real language?
http://wiki.ecmascript.org/doku.php?id=harmony:destructuring
Another aspect in which CS differs from JS is that it provides built-in classes; which i think can make code written in CS much more consistent compared to JS, where everyone seems to like inventing their own way of writing classes.
And i'm sure i'm forgetting other aspects in which CS differs from JS that i wouldn't consider "just syntactic".
For some language X where Y “compiles to “ X, Y is a new language if it introduces new semantics. For example, pure functional semantics, or object-orientation, or pattern matching, or method flavours, or static typing.
One easy test for this is to ask whether compiling Y to X can be done in small chunks or whether it requires “Whole program rewriting.” For example, transforming a program with continuations into CPS requires whole-program rewriting. I would call any language that adds continuations to JavaScript a new language on that basis alone.
CoffeeScript is almost entirely local transformations. I think of it as JavaScript.
Javascript has a distinction between statements and expressions, while to my knowledge CoffeeScript does not. "Everything is an expression" is a huge difference in semantics even though nothing has been added.
• a classical object model, complete with super()
• forced strict equality
• loop-local index variables (gets around the setTimeout(function() {console.log(i)}, 100) problem)
• all variables local unless explicitly declared otherwise
• CoffeeScript's splat arrays are totally different from JavaScript's arguments object
• list comprehensions (whether this is a semantic or syntactic change is debatable, I suppose, but the same could be said for basic OO)
• everything is an expression
The last one is a biggie that completely changes the meaning of many seemingly identical blocks of code. If that isn't a semantic change, what is?
Are they the same language?
Can any one employee give a gist of how used it is in production? From what I've seen I would love to use coffee (I've actually used coffee in reverse, to tweak out a javascript function), but I'm wondering if I'd be lowering my productivity.
What I mean by that is, if I wrote coffeescript, but everyone else worked in javascript (or compiled coffee), then it'd be silly of me to continue doing so. Similarly I've watched a lot of node module development over the past year, and only once I've come across a module written in coffee.
I do of course realize NodeJS in itself is not "very" widespread yet, but are there any node users who can shed some light on the possible future of coffee in node?
Apart from that, I believe you should try coffeescript or any language you become interested in, it's a very way to keep on improving, opens your mind to different paradigms too.
Incoming hatred.
posts flamebait
predicts flames