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.
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.
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?
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.
> 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.)