
CoffeeScript: Accelerated JavaScript Development - shawndumas
http://www.pragprog.com/titles/tbcoffee/coffeescript#
======
rmason
Trevor, Let me know if your book will include a simple CRUD app written in
CoffeeScript using Node.js. That alone would gain you a few more sales.

~~~
TrevorBurnham
Hmm, I'm afraid it's a bit late to add another project to the book (there is a
Node project, but it doesn't use persistence), so how about if I write this
and post it somewhere else? Would you prefer MySQL or MongoDB?

~~~
rmason
Thank you! For the widest possible appeal I would choose MySQL.

------
TrevorBurnham
I'm the author.

I was planning to post this link later, when the book becomes available. I
can't share any details yet, but look for an announcement next week. I run
@coffeescript on Twitter, so you'll definitely stay updated if you follow me
there.

~~~
shawndumas
Get the "add to wish-list" button working on the pragprog.com page. Please and
thanks!

~~~
TrevorBurnham
Thanks, I've let the PragProg folks know. There are a few other updates
pending to that page as well.

Incidentally, you could add it to your wish list on Amazon:
[http://www.amazon.com/CoffeeScript-Accelerated-
Development-T...](http://www.amazon.com/CoffeeScript-Accelerated-Development-
Trevor-Burnham/dp/1934356786/)

------
jamesbritt
What experience do people have with other tools for generating javascript?

[https://github.com/jashkenas/coffee-script/wiki/List-of-
lang...](https://github.com/jashkenas/coffee-script/wiki/List-of-languages-
that-compile-to-JS)

I'm wondering how they compare, and what people have to say.

~~~
TrevorBurnham
Many of those tools (including Coco, a CoffeeScript fork which is,
objectively, more feature-rich) provide features to help manage asynchronous
control flow (that is, to make callbacks look more like linear code). These
proposals were rejected in CoffeeScript (see
<https://github.com/jashkenas/coffee-script/issues/350>) because they take the
language too far away from the underlying JavaScript—in particular,
CoffeeScript code would no longer necessarily have the same order as the
JavaScript output.

For heavily async code, those other tools are well worth looking at.

------
elliot42
For those unfamiliar with CoffeeScript: <http://jashkenas.github.com/coffee-
script/>

------
gsiener
So here's a related question. If someone wanted to snag a developer that
really understood coffeescript and js development, where should they be
looking?

~~~
danenania
Someone who really understands js can pick up coffeescript in a few hours, so
don't pass on a good js developer just because they haven't yet made the jump.

~~~
geraldalewis
I don't completely agree -- I feel like CoffeeScript shares as much in common
with Ruby and Python as it does with JS. I'd say a good _developer_ would be
the best fit for a CS position; depending on your deployment platform, I can
almost see a case where being an embedded JS programmer might actually cause
issues. If all you understand is EcmaScript, all you'll write is EcmaScript.
Despite its tagline being "It's just JavaScript", it's actually much more.

~~~
danenania
I knew Python and Ruby before I started with CoffeeScript, so perhaps that
colored my experience. CoffeeScript is basically a minimalized blend of js,
Ruby, and Python syntax-wise. But I still think someone who understands js
will pretty much automatically get CoffeeScript concept-wise, at least to the
level they get js concept-wise, because the central concepts of programming in
CoffeeScript aren't different than js, just the syntax.

------
geraldalewis
This is really great to see -- correct me if I'm wrong, but Trevor must be one
of the biggest contributors to CoffeeScript. It's great to have someone so
intimately familiar with the project author one of its first books.

~~~
TrevorBurnham
I'll correct you. :)

Code-wise, I'm only a minor contributor to CoffeeScript. I wouldn't be the
right person to write a book on how the CoffeeScript compiler works.
(Thankfully, some of those people agreed to be technical reviewers for the
book.) But I have been an active participant in the language's community from
early on.

~~~
geraldalewis
I think I mostly recognize you from CoffeeScript's #issues on Github, where
your comments are cogent and insightful.

------
EdwardMSmith
Hmm, no beta. Love to see a sample chapter.

~~~
shawndumas
Agreed; but with an availability date of 2011-06-20 we should see something
soon.

~~~
TrevorBurnham
The book's page has just been updated with a few excerpts:
<http://pragprog.com/titles/tbcoffee/coffeescript>

Criticisms welcome. We're aware of some technical issues (most notably,
there's no syntax highlighting for the CoffeeScript snippets), which will be
fixed shortly.

~~~
EdwardMSmith
Just bought the combo - looking forward to going through the beta! Thanks!

------
wsxiaoys
Just a a question: is there any project trying to wrap the Lua with some ruby-
like sugar just like what CoffeeScript do to javascript?

I think that will be fun since Lua's syntax is ... not so sweet i think.

------
rgbrgb
Can't wait for beginner programmer books in CoffeeScript.

~~~
TrevorBurnham
Unfortunately, it isn't really possible to understand CoffeeScript without
understanding JavaScript, so it's not a very good choice of first language.
JavaScript is. So, the book assumes at least a beginner-level understanding of
JavaScript.

~~~
rgbrgb
I have to disagree with you there. As there is a 1-to-1 mapping between
CoffeeScript and JavaScript, I'd say that they are equally hairy first
languages but the former has nicer syntax. The beginner documentation and
workflow just isn't there with CoffeeScript yet. I'm actually not totally sure
why you say that it isn't possible to understand CS without knowing JS. Is it
because CS compiles to JS? If that's the case, I'd point out that you
definitely don't have to know bytecode to learn Java.

~~~
TrevorBurnham
Well, the "JavaScript is the new bytecode" analogy only goes so far. JVM
bytecode puts few limits on what your language can do efficiently—Java, Scala,
and Clojure, for example, all have great performance, despite having very
different idioms. CoffeeScript, on the other hand, was clearly designed around
what you can do with JavaScript. Or more precisely, what you can do while 1)
producing predictable, readable, 1:1 output, and 2) getting good performance.
So I think CoffeeScript is best understood in light of those limitations.

Plus, learning CoffeeScript wouldn't be much use if the docs for every JS
library read as gobbledygook, right?

~~~
rgbrgb
Yeah, I guess I was overreaching with my argument about bytecode. But, we can
probably agree that it's more enjoyable to focus on writing good CoffeeScript
than on writing CoffeeScript which will compile to good Javascript. Regarding
the libraries, couldn't the same be said about learning Clojure without
knowing Java (something which I think would currently be pretty acceptable)?

All I'm getting at is that I'd like to see CS eventually become a language in
its own right rather than an extra tool for JS developers. I think this is
completely feasible if we start treating it that way and create the tools and
documentation to that end. I think it is a serious improvement over JS and
could eventually replace JS for the common programmer.

By the way, thanks for all your work, I'll definitely be picking up the book.

~~~
TrevorBurnham
> All I'm getting at is that I'd like to see CS eventually become a language
> in its own right rather than an extra tool for JS developers.

Yeah, totes. Brendan Eich himself has assured me that the Mozilla folks are
dedicated to adding debug support for CoffeeScript (and other compiled JS
languages) to Firefox. So the underlying JS will be less and less of a concern
as the tools get better.

At the same time, though, that'll probably lead to languages that go further
than CoffeeScript taking hold, just as Clojure is rockin' it on the JVM
despite being really far removed from Java. I like CoffeeScript a lot, but
when JavaScript really does become bytecode, people will want to code in
something less JavaScript-like. (Or CoffeeScript may become the new C...
"assembly with syntax," in pg's words.)

------
TrevorBurnham
Now in beta! Reposted here: <http://news.ycombinator.com/item?id=2507418>

------
kennymeyers
I still don't understand why I would want to use CoffeeScript when I can just
use JavaScript.

~~~
aaronbrethorst
Assembler and C.

Java and Scala.

Erb and Haml.

CSS and Less/Sass.

Edit: Walking and driving.

~~~
unshift
Asm/C and Java/scala are unfair comparisons, since they're totally different
languages with different structures and idioms.

I just started using CoffeeScript for a project of mine and while it did clean
up the messy look of the Javascript, it doesn't improve much upon Javascript
feature-wise. I felt like I was still writing Javascript, it just looked a
little better.

~~~
snprbob86
I've been writing CoffeScript daily for about 4 weeks now. On the first day,
it seemed pretty minor. About three days in I was a believer. Now, when I
write the occasional few lines of Javascript in my browser's console, it just
feels so arduous to type. Whenever I pop open a Javascript library to read it,
I feel like there is an assault on my eyes. I'm never going back.

------
FreshCode
-1 post it when it's ready, not when you're ready to start promoting it.

~~~
shawndumas
I, the OP, am not the author. I posted because I was excited.

