Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

> What I find sad, though, is that most people who dislike CoffeeScript don’t truly know it. They haven’t taken the time to really learn it, or even try it. Their reactions are usually knee-jerk, or based on fallacies. [...] The explanation for most people’s dislike of CoffeeScript is probably our natural resistance to new things and our comfort in what we know.

Oh, wow. I've been using CoffeeScript for about a year for the usual front-end crap, not long ago I re-evaluated Coffee for the second time before starting a full-JS project and certainly won't use it. While I'm a fan of bracketless whitespace significant langs (Python, Sass, Haml) CS's is just bonkers and you never know when a single space will bite you by compiling to a completely different code you had in mind. The ecosystem is weak not to say non-existent comparing to JS, and every JS solution and example out there from minor jquery stuff through SPA frameworks to mobile UI builders is in, well, JS (duh!), so public code reusability becomes a ridiculous task of converting to CS, only to compile it to JS once again. I still use CoffeeScript for small front-end work, meanwhile for any bigger work I find CS an obstacle over JS, and an unnecessary step between my idea and working code; especially when the JS ecosystem has grown a lot of tools to help you deal with what pisses you off (underscore/lodash as an example come to mind).

And from the slide:

> And as of July 2013, it's also the tenth most popular language on GitHub! That's more than Objective-C, ActionScript, C#, Clojure, Go, Groovy, Scala

Yay github charts as evidence of industry value.

Knee-jerk, fallacies, resistance? Call it what you want and good luck. Meanwhile, I will use coffee to keep me awake, not to write apps with.

//edit: care to explain the downvote?



In my experience of using CoffeeScript, the author is absolutely correct. CoffeeScript is rejected for reasons "usually knee-jerk, or based on fallacies." I introduced it respectfully and fairly in a former team, and at first people are generally fainting and acting like the world will end.

(This is backend node.js work which emphasized tests and code review. I don't know what it's like outside that.)

Not all rejection is knee-jerk. "Usually" is the operative word here. I would have loved knowledgeable, reasoned critique. I personally assembled as many reasoned critiques as I could, to demonstrate my respect for reasoned, fair decisionmaking. I am continuously disappointed by the low standards of discourse, in programming culture.

(The first random misbegotten idea which pops into my lizard brain to confirm my prejudices, is not a sufficient "reason".)

Eventually, most realize CoffeeScript's sheer maintainability can far outweigh CoffeeScript's (real) flaws; some former detractors become downright zealots. Sure, some still dislike it; but they tend to be ignored because it's really not that bad. Nothing compared to the real problems that a team encounters.


I don't understand the "ecosystem" complaint. Every JS lib is interoperable with CS, so the only things needed in the CS "ecosystem" is syntax specific tooling. We'be got source maps and syntax highlighting for most editors, and most other JS tooling should work fine.


I love CS myself. To me, in terms of aesthetics, CS is to JS what Scala is to Java. I have been bitten by the whitespace issue that you mention though. I don't recall the circumstance but an indent that was off just a bit did not cause the compiler to complain, but did cause it to generate code that I did not intend. It took some debugging of the JS output to find that one, and it certainly gives one pause to think how similar bugs might slip into the code undetected. I've never encountered this kind of problem with Python, so I wonder if the CS compiler just needs to be a little fussier/smarter with its whitespace processing?


Compilers/interpreters complain about code that's invalid. Since the code is valid it shouldn't interfer, the problem is in the language's syntax design that's prone to shooting yourself in the foot. The design lets you mix indentations, something that Python won't let you do.

A very simple scenario where hell is a keystroke away:

    hello =
      woot: 1
      yay: 2
      funfunfun: (x) -> x + 1
    
    hello2 =
        woot: 1
        yay: 2
       nowthatsfun: (x) -> x + 1

Other:

    y1 = (x) -> 
        x + 1

    z1: (x) -> 
        x + 1
      
      
    y2 = (x) -> 
        x + 1

    z2 = (x) -> 
        x + 1
http://js2coffee.org/#coffee2js

Those are fairly visible here, not so much on a huge codebase (not to mention with some callback hell attached). You can write perfectly legal code that just doesn't work as expected.

//edit:

worth a read, with more trap examples http://ruoyusun.com/2013/03/17/my-take-on-coffeescript.html


While the examples are completely accurate, I've just never run into an issue like that in practice. The majority of my codebase is CoffeeScript and it's just never been a problem.

It's pretty visually obvious when your indentation is out of whack. Even if it isn't, this kind of error would be picked up pretty quickly by your test suite.


Your second example though exists in exact the same way in python and ruby. Some people prefer to hunt for missing comma's and brackets, others for spaces.

I think that's a matter of taste. Coming from python, I've quite enjoyed coffee-script's syntax and I've actually done something in between, using brackets for objects just because I like the readability of it, but avoiding all semicolons and taking advantage of the indentation for code blocks.


Yes, the second is a bit forced, couldn't remember what was the other case I banged my head against the desk. I'm a Python programmer too, maybe that's why I expected the language will prevent me from mismatching blocks of code. Well, even sass and haml (which aren't full-blown programming languages) aren't that easy to mess up. Using Python convention (4 spaces indent) instead of the unofficial but common ruby/js/sass ones (2 spaces) helps a bit to spot out obvious bad indents, but still - in general I don't find the language trustworthy enough to jump into something big with it (for all the reasons I listed before).

btw added a link above with some more syntax gotchas.


Indenting with tabs (that are displayed as wide as multiple spaces) would make the first scenario much more noticeable.


Comparing Coffeescript to Scala is an outrage! ;)

When I heared about Coffeescript I thought about Scala, too. Not because it reminded me about Scala, but who it took to make Scala and then out of the blue some guy comes along with some new lang, which should ease some problems.

CS is to JS what PHP is to Perl.


(I didn't downvote you.)

It's great that you tried CoffeeScript and prefer JS. Your opinion is well-formed.

With my statement, I was referring to the many developers I've encountered who haven't tried it, yet actively dislike it and argue against it. Hence the (subjective) "most" in my first sentence that you quote.

Cheers.


(I know, OPs can't downvote direct comments)

You're right that people should try out stuff before criticising, and in general I support the notion; yet I fully understand people who don't want to jump ship onto very new things because leaving a well-established environment for an immature/unstable one can (but doesn't have to) be a risk. At least Coffee is relatively easy to leave - just take your compiled code and get rid of the source.

I'd also like to add for the rest: what convinced me to try Coffee was @jsjabber podcast with the author http://javascriptjabber.com/017-jsj-coffeescript-with-jeremy... - I think it explains the concepts pretty well (I recommend the whole podcast btw, it's great) and I encourage to listen to it if somebody is curious and wants to try out.


I'm in the same boat. Used it for a big project and now it's just cruft on my Javascript files. I have to continuously mentally process Javascript code I want to use from other libraries into its CS equivalent, and for what? All I get are list comprehensions and white space.

I originally found it very appealing because I wasn't well acquainted with Javascript or its prototype class system, and so I didn't have that life-saving knee-jerk reaction about CS at all. I dove right in and used it extensively. After getting used to both JS and CS, I've realized that Coffeescript is at best a Javascript obfuscator.

I understand the use of some layers on web tech. SASS is great. It introduces constructs that you legitimately can't get in CSS, like functions and variables. Coffeescript on the other hand is just a toy for the Python devs that are too lazy to properly learn Javascript.


> The ecosystem is weak not to say non-existent comparing to JS

In what circumstance is it appropriate to consider the CoffeeScript ecosystem to be distinct from the JavaScript ecosystem?

> [...] and every JS solution and example out there

It seems impractical to regularly code in CoffeeScript without being fluent in JavaScript.

FWIW I agree with you about CoffeeScript being a little finicky about the syntax. There's the bit a seemingly unimportant (non -leading) space char generating dramatically different results, and also things like:

    if foo and bar is x
not grouping the way you'd (or at least I) expect.


> In what circumstance is it appropriate to consider the CoffeeScript ecosystem to be distinct from the JavaScript ecosystem?

Example code, debugging tools, message forums, developer teams.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: