If you're considering trying Coffeescript, here are a few thoughts for you. Remember that the Vim plugin for Coffeescript compiles your Coffeescript to a js automatically every time you save, and it even shows you immediately if there are any errors. I've had difficulty setting up other Vim plugins, but this one was blessedly simple to get going.
An awesome tool for helping you to learn Coffeescript is the "Try Coffeescript" tab on http://coffeescript.org/. This lets you type a little bit of stuff, and see how it translates into Javascript, in realtime, while you type. I still use this today when I'm trying to verify I'm on the right track with a bit of punctuation (meaning, leaving punctuation out, usually).
Have you tried CoffeeScript and what are your thoughts on it? It's clearly not 'done' yet but I found it really helps clean up my scripts, reduce the amount of typing and avoid a lot of tricky JavaScript mistakes.
Yeah CoffeeScript is pretty easy to learn and doing things like configuring snippets seems like a good use for it.
In general tho, I am pretty hesitant to go all in with CoffeeScript, mainly because you still have to watch and massage the javascript output, negating any time saved for me at least.
I started using it last month, on production code. I work as a Javascript programmer in an otherwise all-Java software shop. I come from a Python background. I really love it.
I have Vim all set up to auto-complete it, to syntax highlight, and to auto-compile whenever I save. The bad news is: No Eclipse plugins, no notepad++ plugins. etc. So the only other devs who can work on it are on Mac and Linux (which to be fair, half of my company are on Ubuntu, but there's that 1/3 of the company on Windows that just can't practically work on coffeescript code).
The author uses CoffeeScript for completely different reasons than I do. While a lot of the convenience features of CoffeeScript are awesome, I use CoffeeScript more to compile JS to standards-compliant, consistent code. Variables are hoisted, commas are automatically inserted, semi-colons are taken care of, and the entire script is put into a lovely self-invoking function that helps fool-proof things.
Furthermore, because CoffeeScript requires (sort of) a compilation step, errors are caught and debugging becomes MUCH easier than it ever was with plain JavaScript. Most text editors now have plugins that will compile selected text to JavaScript so you can preview the end result and make sure that you're getting the output you want.
The better part? When JavaScript best practices evolve, CoffeeScript can evolve with it, but the code can more-or-less stay the same. Awesome!
Thanks. CoffeeScript looks interesting - quite Rubyish, although I'd be a bit worried that by going that route I'm going to end up having to learn both syntaxes (syntaxi ?-) to understand / debug the resulting JavaScript, or to make use of other JS code snippets.
Interesting blog article BTW, and part of the reason I picked JS to have a bash at.
I second this. I use and like CoffeeScript, especially if I'm pretty sure nobody else will touch my code, and especially if I'm just tinkering or exploring.
But after doing a lot of mostly CoffeeScript, I had to do some 'plain' JS work, and it took me a while to get back into it. And that can be a problem if you just need to get stuff done sometimes.
(PS: kudos for submitting this! I'm more than a decade older than you are, and I get nervous just thinking of sharing my code with this crowd!)
As an additional testimony, I've actually been learning coffeescript without really knowing JavasScript, and it has actually gone fairly well. For the most part it's intuitive, and if you're willing to be a little frustrated figuring out some of the syntax changes it can be rewarding.
An awesome tool for helping you to learn Coffeescript is the "Try Coffeescript" tab on http://coffeescript.org/. This lets you type a little bit of stuff, and see how it translates into Javascript, in realtime, while you type. I still use this today when I'm trying to verify I'm on the right track with a bit of punctuation (meaning, leaving punctuation out, usually).
reply