How I Learned to Stop Worrying & Love the CoffeeScript
Author's Note: I took about a six-month break from code-blogging there. Unintentional. I had a new job, but that's not much of an excuse. Time to get back on-track.
It is a fact universally acknowledged that JavaScript is sort of terrible. And yet between Angular, Ember and Node (to name just a few, in alphabetical order) it's also pretty clearly the way forward, or at least an inescapable facet of the future of the web.
Make no mistake: I'm glad I learned Rails first. I'm working with Rails right now, and being paid for the privilege. Rails's star may be waning, but it's not about to disappear off the map. It's role is simply changing, at the moment; it remains the right tool for some jobs. And for other jobs there are different, better tools.
Through no one's fault but my own, I left Launch Academy with an inadequate understanding of JavaScript. I had friends in my cohort who applied themselves to the study of the bracket and the semicolon (and built some pretty nifty toys in the process) but I was too far in the weeds -- or so I thought at the time -- to even consider taking on a second language.
And then I got into my current position, which involves being a full-stack developer in several senses of the term. I control the horizontal, I control the vertical, and if I get stuck on a particularly nettlesome bit of front-end development, I have no one to turn to but myself. Which is, of course, a bald-faced lie -- I'm in near-constant touch with my friends and teachers from the Launch community. Many of whom have proved very helpful at getting me un-stuck.
What has proved equally helpful is CoffeeScript.
CoffeeScript, for the uninitiated, is JavaScript. There's more to it than that, but the fundamental and most important truth of the matter is: it's just another way of writing JavaScript. A better way, some would argue (myself among them.) CoffeeScript enabled me to leverage the patterns I had already learned and write idiomatic code that behaved (more-or-less) the way I expected.
And in that 'more-or-less', I found myself learning all manner of things about JavaScript. Concepts as simple as declaring variables, which had eluded or puzzled me when I was looking at them on top of learning Ruby, were illuminated by the tools that CoffeeScript provided. Even things as basic as looking over its documentation and seeing how the idiomatic concepts were ultimately rendered as JavaScript became a useful didactic on how things were actually being accomplished.
So now I write CoffeeScript. It serves my client-side needs for my Rails app at work. And through its lens, I am backing my way into understanding JavaScript, and even writing JS first, when the occasion calls for it (which it does less frequently than you might think.)
In a funny way, this might never have happened if I'd started in on it while I was still at Launch. Certainly I didn't encounter any strong proponents of CoffeeScript there. It seemed to be regarded as something of a crutch (a viewpoint I don't entirely disagree with) and a curiosity. This in spite of the fact that it's been part of Rails since version 3.1.
Gradually, however, I am becoming my own best advocate for learning CoffeeScript. I've always been brassy and opinionated, but there's nothing like having a soupcon of real-world, rubber-meets-the-road professional experience to make people pay a lot more attention to what you think. Which only makes sense, really. But that's where I've landed, for the moment: CoffeeScript is a great tool for teaching people who are already learning Ruby/Rails the things they'll need to get started with JavaScript.
And if you already know some JavaScript, and waved off CoffeeScript because you thought (or someone told you) it was nothing but a dumbed-down version? Look again. You might just be surprised.









