For someone who is new to Javascript (and programming in general), how do you know when it'a ok to move on to coffeescript? (I started with ruby and I like how coffeescript has similar syntax)
Early in my Javascript career, I read "Javascript: the good parts", and started with Coffeescript very early. And I very often would look at the Javascript that Coffeescript was generating for me. I was pleased to find that Coffeescript automates a lot of the things that the book recommends. Totally worth doing early, in my mind, especially if you're interested in Coffeescript.
Don't consider learning a language like CoffeeScript or ClojureScript until you thoroughly understand JavaScript. I think it's much easier for a beginner to learn JavaScript APIs (both built-in and third-party), which you'll need, from JavaScript examples without having to translate them to another language in the process.
Also, I'm not sure you can use these other languages' features judiciously without understanding their reasons for doing things a certain way. You will need to know how `this' and `prototype' are used and things of that nature, then you can decide if you find the abstractions and overhead of compile-to-JS languages useful.
Spend a weekend building a tiny project with CS. Or use it to add a small feature to a project you already have.
You have to constantly be on the lookout for new tools that will give you new capabilities or make it easier for you to do the things you already do. So you should be willing to try something different like CS -- recognizing that it's a learning experience and it might not work out.
It's fine if you decide that CS isn't the best, and you want to stick to plain JS. Not every tool works well for every person. Sometimes everyone raves about the goodness of technology X, you try it and agree. Other times, you try it and hate it.
Sometimes you come back months or years later to a technology that gave you bad experiences, and due to changes in both you and the technology, you're pleasantly surprised. Or a long-proven technology that you've been using for years has slowly but surely been surpassed by something else, and is now nearly obsolete.
So it's not guaranteed that CS right now will work out for you, but you don't know until you try. And even if it doesn't, you should keep it in the back of your mind and take another look in a few months or years.
Probably right now. But that's a good question. As you've already seen, the documentation on http://coffeescript.org is phenomenal.
As a dev with maybe 1.5 years of JS experience, I've learned coffeescript in a week. I still don't have the coding style that my code reviewers want, but I'm writing functional code.
The biggest hurdle I've found is getting an auto-compiler for coffeescript. You don't want to do it manually:
I have not had great luck mixing coffee --watch and gvfs for either FTP or WebDAV. An ugly, but effective solution is to configure your editor to compile on save. The most annoying part of that is when you switch to a project with a different build process, and you have to either reconfigure your editor, or deal with extraneous .js files being output.
You can also ask yourself what step of learning you're at. Do you just want to build stuff? Then you can probably jump to coffeescript right away (especially with the new Source Maps feature). Do you want to get more in-depth knowledge of popular programming languages? Then stick with JS; learn how it handles types, how it handles functions, what the prototype chain is, how exceptions are thrown, etc. Maybe even read JavaScript: The Good Parts.
People build amazing sites in both languages... so you can't go wrong... it's just a matter of what you want to learn on the way. Good luck!
Agreed. CoffeeScript is a leaky abstraction of JS; the underlying paradigm of JS still peeks out even though it's papered over (see the fat arrow =>).
Once you have a grasp of JS (and the things you might not like about it), you can then move to CS. When something looks a bit off in CS, you'll probably be able to translate why it is that way due to the JS underpinning.
Since I've programmed JS before CS was created, I've long been resigned that I'd have to understand and follow the idioms of both languages. But using CS is so much sweeter to read and write that I end up being lulled into thinking that I'm writing Ruby. I can't tell if my brain is taxed more at having to switch between Ruby and regular JS, or if it's more tiring to constantly remind myself "this is not Ruby. This is not Ruby. This is not Ruby" while writing long stretches of CS :)
But I've only dabbled with CS so I'm sure like with anything, practice reduces this mental fatigue. I am bummed that CS went to camelcase, but the justification back then was a good one
I think it could work well to start with CoffeeScript -- that is, to learn JavaScript by first learning CoffeeScript. For the real world you must understand native JavaScript, of course, but that could come incrementally. I don't actually know anyone who's done this, however.