
Why Do All the Great Node.js Developers Hate CoffeeScript? - roh26it
http://procbits.com/2012/05/18/why-do-all-the-great-node-js-developers-hate-coffeescript/
======
raganwald
I've been accused of writing linkbait-y titles in the past, such as
"CoffeeScript isn't a language worth learning."

[https://github.com/raganwald/homoiconic/blob/master/2011/12/...](https://github.com/raganwald/homoiconic/blob/master/2011/12/jargon.md)

So I suppose I'll have to just say that looking at the article itself and
argue the content rather than the packaging. So here's the premise: A bunch of
great JS developers aren't also CS developers.

Possibility #1: Correlation == Causation. Writing CoffeeScript rots your brain
and makes you unfit for writing great Node.js code.

Possibility #2: Writing great Node.js warps your brain such that CoffeeScript
is unpalatable.

Possibility #3: Writing great Node.js code means you're very comfortable with
JS itself and your tool chain, and thus you look askance at _any_ switch.

I'd say that both #2 and #3 are far more likely than #1. Neither of them imply
that you shouldn't use CS today if it seems appealing.

~~~
masklinn
I'd give 3 more possibilities:

#4 pretty much the only advantage of CoffeeScript is saving a few keystrokes,
not worth spending time on

#5 most of your day is still spent reading javascript, the mental overhead of
switching between JS and CS all the time makes it unappealing

#6 using javascript makes for writing better javascript libraries than
coffeescript

~~~
raganwald
#5 is probably true for many people. #6 might be true, might not.
Amplification of your ideas would be welcome.

#4 needs some clarification. If you're making a global statement, then you're
contradicting my experience and the statements of many CS users. Agree or
disagree, clearly it's "debatable" and not axiomatic accepted fact.

Or you might be saying that for _some developers_ , including the quoted node
developers (and possibly yourself), there are insignificant benefits. I listed
the possibility that the node developers saw no significant return on
investment, so if that's what you're saying, then we agree.

~~~
masklinn
> Or you might be saying that for some developers, including the quoted node
> developers (and possibly yourself), there are insignificant benefits.

Exactly, I read your comment in this style (which seems to have been correct
according to what follows my quote) and decided to use the same. These were
not intended to be understood as the absolute truth brought down from the
mountain.

Although some of these points do roughly match my thinking (if I'm going to
learn a not-JS-but-compiles-to-it, I'd rather use something drastically
different which can bring significant gains — e.g. Roy or ClojureScript — or
build -my-own via SweetJS than limited syntactic sugar)

------
tmcw
Great node.js developers are writing libraries, not application code, and they
see a difference: libraries are abstractions that try to build upon as little
abstraction as possible, and attempt to integrate with as many 'things' as
possible.

CoffeeScript's advantages - clarity and concise code - are outweighed by the
feeling of building on an abstraction, and narrowing your contributor base.
This feeling may be increasingly inaccurate: a lot of people write
coffeescript, it's pretty well integrated nowadays.

~~~
tjholowaychuk
we write plenty of application code actually, all of us listed there I'm sure,
we just dont give a shit about the "features" coffeescript "adds"

~~~
davej
> 'we just dont give a shit about the "features" coffeescript "adds"'

I'm not sure why you're claiming to speak for the other nine developers listed
in the post.

It's a good point that tmcw makes. Plenty of developers, including Jeremy
Ashkenas (creator of CS), write their open-source library stuff in vanilla
javascript while hacking away with CoffeeScript for other things which don't
rely on community contributions.

------
account_taken
I don't get it. Look at Jade, Stylus ... pythonesque isn't it. The same
arguments that are made against CoffeeScript certainly can be argued for those
sugar syntax alternatives of HTML and CSS respectively. Some will argue ad
nauseum for not using semicolons and then hate on CoffeeScript.

I've had no problems debugging or understanding CoffeeScript and while I'm not
at the level of a Jon Resig, I can more than hold my own with Javascript.
CoffeeScript is just syntax and generally safer than plain Javascript. It will
declare vars for you if your forget. It will use an optimized for loop. It
will put a wrapper around code to minimize leaks ...

~~~
tjholowaychuk
The main difference there is with stylus / jade you basically have two states,
tag and non-tag, rule and property, so it's much less ambiguous. Once you get
into lots of logic in either however they similarly ambiguous, there's no
doubt about that

------
jrajav
TL;DR: Several high-profile Node.js developers seem not to have used
CoffeeScript for any of their public projects (unless you count forks). In
addition, some unspecified expert Node.js devs (perhaps the same ones, perhaps
not) made an unspecified joke involving CoffeeScript on a podcast. Therefore,
all the great Node.js developers hate CoffeeScript.

I'm not arguing what the article seems to circle around to near the end - that
CoffeeScript is worth trying - but its nominal premise seems a little shaky.
Perhaps those developers simply feel as I do, that Javascript syntax is fine
and there's not that great of an incentive to switch. I actually like braces
and semicolons, and I definitely prefer function literal syntax to arrow
syntax.

~~~
roh26it
In the end, its just syntax. Some like the python/ruby-esque mode and thus go
for coffee.

~~~
jasonkostempski
In the end it's another syntax, another compiler, several new plugins for your
editor, another dependency, a bunch of new abstraction, another unproven
technology, another black box, etc. It's not so simple, the choice shouldn't
be made lightly.

------
mratzloff
I love CoffeeScript. But then, I am well-versed in JavaScript. People who
don't understand scope, lambdas, prototypes, etc. should stick to JavaScript,
as CoffeeScript obscures some of that. You really should understand what's
going on behind the scenes.

Which makes it all the stranger that experienced JavaScript developers seem to
avoid it, while less experienced ones embrace it.

My main gripe with CoffeeScript (there are a couple, but here's one) is code
organization/readability when a method takes multiple functions as arguments.

    
    
        foo ->
          bar()
          baz()
          quux()
        , (error) ->
          throw error if error
    

That does look a bit odd, and you run into these a lot when you're using
caolan/async. You can avoid this by avoiding anonymous methods, but with so
many callbacks in Node.js that is probably less readable.

~~~
svachalek
You can assign the functions to variables and then make the function call in
one line. Adds one line of code and a lot of readability.

~~~
mratzloff
Yes, but please see my last sentence. With so many callbacks in Node.js, it
can make it just as difficult to follow.

------
Xcelerate
I really love CoffeeScript. Javascript has some great programming concepts
within it and CoffeeScript makes these more elegant and easy to use. The
reduction of needless syntax is also a boon to me.

In fact, I've been using CoffeeScript to postprocess data from molecular
simulations (supercomputer output). It's about 3x less code than an equivalent
C program and requires a lot less thinking so I can get things done quicker.
But I tend to use CoffeeScript in a functional style (which in my opinion is
the best language paradigm for handling a lot of data).

------
dmethvin
There are "systems developers" and there are "applications developers". The
two groups often use different tools, so JavaScript vs CoffeeScript isn't much
more surprising than C vs C++ or Win32/COM vs .NET for that matter.

Systems developers provide services for other developers; generally they want
to minimize dependencies. It doesn't make sense to write foundational tools in
CoffeeScript unless all the clients of those tools will be written in
CoffeeScript as well. Otherwise you're just adding complexity to their
projects and making them harder to debug.

~~~
dschiptsov
_systems developers_? You mean those guys who wrote V8 in C++?)

~~~
geoka9
You mean those guys who wrote C++ in C?

------
dschiptsov
Because CoffeeScript causes a cognitive dissonance by a) Attempting to address
Javascript's shortcomings. b) Shows how much more comprehensible a well-
designed language could be. c) Shows what one smart guy with a deeper CS
knowledge and good taste could do.)

------
Weltschmerz
Personally, I would want to understand JavaScript before moving on to some
abstraction. The official Node.js documentation is written in JS, etc.. Then,
once I am totally capable with JavaScript, there just isn’t a great incentive
for me to learn another language to code on top of the same environment. I’m
very happy with JavaScript. CoffeeScript has become an instant turn-off to me,
and I think this sentiment is common in the community. If someone asks for
help in the IRC channel, I just can’t offer a thing. And usually no one can.
I’ve seen many calls-for-help that fell on deaf ears because few people are
willing to learn CoffeeScript for assisting a fraction of the community. Why
do I hate CoffeeScript? Because I like helping people. :( This is my personal
history, and you may notice that I am totally ignorant of any benefits that CS
may provide by way of being more concise, or linguistically harmonious.

------
geuis
Quote: "Having defected from Rails, I love CoffeeScript."

This is a common reason I've heard. Here's the bottom line, CoffeeScript is
not javascript.

Suppose you want to speak Japanese but only know English. Google comes out
with Translate 4.0 that does realtime translation on the fly. Great! Now you
can speak Japanese, right? No.

Most of the devs I've personally interacted with that like Coffeescript are
conversely bad at javascript. Admittedly this is anecdotal and only based on
my personal experiences.

Learn javascript. Get a book, read some tutorials. Quit trying to squirm
around just because closures make you nervous.

------
lnanek2
This is like analyzing some of the huge Java projects out there, noticing they
don't use Scala, and deciding everyone hates Scala. Particularly with public
projects, you want them as easy to use and simple and require as little as
possible to get into them. Adding an extra language translation will not help
with those things, especially if the language is not as common as the one it
translates into.

I don't particularly like Java compared to some other options, but I still
code in it most, simply because of the huge number of libraries and developers
who use it. It's very difficult to write any big project by yourself, which
means you need others, which means you need to not use obscure languages and
other technologies that prevent working together. I much preferred writing for
Linux PDAs than I do writing for Android smart phones, but if I did that, no
one would use my stuff. :)

------
doomslice
I like CoffeeScript. It makes writing some things in JavaScript a little bit
easier and maybe even a little bit faster.

However, I don't like _using_ CoffeeScipt. It immediately shuts out the other
85%+ of JavaScript users who aren't familiar with CoffeeScript from reading
and understanding my code.

------
agscala
I dislike using coffeescript mainly because the language is _too_ flexible.
Being able to optionally omit a ton of syntax has led to some annoying
problems that aren't obvious at first glance. This ambiguity is exacerbated by
the way javascript is typically used (chained methods, nested lambdas, etc).

The other gripe I have is that debugging it is a pain in the ass since errors
that come back reference the javascript code, not the coffeescript. Apparently
this is a problem being worked on but it's still irritating.

~~~
roh26it
But because nesting is a pain-in-the-ass in coffeescript, I've become used to
breaking down code into chunks and invoking functions which ultimately makes
code more readable solving many other problems.

I do agree on the debugging aspect. I always have to go back to the compiled
javascript to understand errors. Can you please point me to solutions being
worked upon in this regard? Open source?

~~~
jrajav
One of the things provided by the CoffeeScript Redux project is source
mapping, which enables line-to-line correspondences for debugging.

<https://github.com/michaelficarra/CoffeeScriptRedux>

<http://ryanflorence.com/2012/coffeescript-source-maps/>

~~~
roh26it
CoffeeScript Redux project seems interesting. Thanks!

------
steverb
I'm not a great node developer, but I personally don't like CoffeeScript for
the same reason I don't like UI interfaces for Git. I'm never sure what it's
going to do.

Yes, I could go look at the output, or go really learn it, but if my goal is
to produce javascript then it's just another leaky abstraction on top of
something that isn't that hard to do by hand. If my choices were CoffeeScript
or ASM, then I'd choose CoffeeScript in a heart beat.

------
buster
I don't truely see enough benefits for coffeescript. 99% of the eco-system
uses vanilla JS and i would like to stay in one "language" as much as
possible.

In general i don't really feel comfortable with code-generating layers that
abstract away what i want (and need) to know. I want to look into the Chrome
Devtools, see "line 23 in bla.js" and correlate that to the source in my
editor. Same reason i don't use all that less/sass/haml etc. etc.

------
grabastic
I doubt that the CoffeeScript-haters would accept any compile-to-js language.
Maybe it's language stockholm syndrome. ;)

But for me, JavaScript's shortcomings are far worse than CoffeeScript's.

------
pjmlp
I don't care about any language that isn't natively supported in the browsers.

Not all browsers have support for source maps, and sometimes you really need
to debug browser specific behaviours without having to debug generated code
along the way.

Additionally in most teams I work on, it is often the case that besides myself
no one even knows what CoffeScript is.

CoffeScript just adds more code to debug without any real benefit.

------
gavinflud
I'm not a very experienced Node.js developer, but I have taken the time over
the last couple of months to learn how to use it. I find working without
CoffeeScript to be much more productive.

Then again, that may change when I get a lot more comfortable using Node. At
the moment I just prefer to know exactly what's going on under the hood.

------
jtchang
The reason I have not learned coffeescript yet is because I want to truly
understand javascript. I feel that learning something more portable is the way
to go. As I understand more javascript I think about what problems
CoffeeScript is trying to solve.

------
JimmaDaRustla
I'm learning the variable scope of javascript very thoroughly because it is
powerful. I don't want to be hindered by shortcuts eliminating some of that
power/understanding.

~~~
tluyben2
Without trying in jsfiddle, what does this alert;

var i=3; function x() { alert(i); var i=5; } ​x();​

and why is this powerful? I agree with you mostly, but I don't like this
'feature'.

Edit: hoisting yes, but why, besides compiler optimization is it more powerful
for the programmer than if it would not do hoisting, or, why is it in a modern
language like JS?

Edit1: I'm not in favor of coffeescript I used Javascript most of the time
during my work day, I was just seriously wondering, if not for low level
optimization why it would be a problem to have global scope until local is
defined.

~~~
JimmaDaRustla
Undefined, that's hoisting.

I think it is dirty, but the point of the var statement (and your hoisting
example) is that you implicitly imply the variable scope. In Coffeescript, you
just do an assignment and it will be function scope if it (the variable)
doesn't exist in any parent scopes? That seems dirtier to me and dangerous.

If you are awesome and namespacing and keeping clean/modular/maintainable
code, Coffeescript may work great.

~~~
JimmaDaRustla
Someone correct me if I'm wrong, because I'm not a pro by any means: var
statement allows for implied variable scope and avoid variable collisions from
parent scopes

------
carsongross
I question the premise.

------
todd3834
I just love JavaScript

------
addlepate
Jeez, there's the word "hate" again, second time this morning. What a bunch of
drama queens we all are. Not particularly caring for a language or disagreeing
with the premise for its creation is "hating". OK. And here it's even worse,
because the author elevates these developers to the status of "great" and then
paints the fact that they do not care for CoffeeScript as "haughty".

