I’ve alluded before that I did a large chunk of my development in some form of ECMAScript for the first ten years of my professional life. Now, JavaScript is cool again for the first time. Everyone wants to learn it.
So, like me, you probably already kinda maybe knew JavaScript. But times have changed and now it’s a serious language. How do you get up to speed? Here’s what I did.
Read Some Books
Eloquent JavaScript
This is probably the best book to start with if you are really rusty (which also includes plain ol’ new as well). Personally, I found the book a bit tedious and I didn’t quite finish.
Did I mention that it’s free?
JavaScript: The Good Parts
An essential read for modern JavaScript development. It’s short and terse and easy to read. Douglas Crockford is highly regarded, though he can get occasionally harsh some mellow. He’s the supreme overlord author of JSLint, a nifty tool that’s useful for detecting the not so good parts in your own JavaScript. The information in this book is foundational and I recommend reading it soon.
JavaScript Patterns
This book is awesome. Seriously. Someone should give Stoyan a trophy. It deals with higher level patterns in your JavaScript applications. Be sure to read it after you become comfortable with core language concepts.
High Performance JavaScript
I haven’t actually read this one yet, but it’s on my list. I have however heard Nicholas C. Zakas speak and from that I suspect that the content will be excellent.
Staying in Touch
I’ve found it a little difficult to stay abreast of what’s having in the JavaSCript community.
JavaScript Weekly
The weekly podcast and its associated newsletter have been excellent. Highly recommended.
On the Interwebz
Start with Elijah Manor. Aside from just being a good guy, Elijah is a perpetual fountain of information. So, you’ll want to follow him on Twitter. Caveat: Following Elijah is drinking from a firehouse.
I also recommend:
- Matthew Podwysocki A fellow ‘softie who is aware of all things JavaScripty.
- Stoyan Stefanov from Yahoo
- John Resig of jQuery fame
- Nicholas C. Zakas
- Rey Bango
- script junkies {}
I’m sure there are many other resources. Please add additional ones in the comments.
Some Thoughts
Here’s a few thoughts about learning JavaScript. Take them or leave them, but these are my current opinions.
Prototypes, not classes
JavaScript is not a classical language (that’s fancy talk for ‘class based’ language). Sometimes it looks classical, and may even taste a little classical, but really it’s not. Don’t try to force it. I think you’ll be happier and you’ll write happy little functions if you embrace it’s prototypical nature. If you don’t understand the difference, that’s okay. You will after reading the books I listed above.
Don’t confuse the language and the environment
We mostly know JavaScript through browser development. As such, we’ve generally confused the inside evil of the DOM with JavaScript itself. Or at least we did before jQuery rescued us.
However the browser isn’t the only environment. For the troglodytes amongst us, you can use Node.js and write JavaScript on the server.
Leverage the natural strengths
Each of these concepts deserves a post (or more) on their own, so I won’t go into details.
- It’s a dynamic language. JavaScript is squishy and that’s good.
- It has many functional characteristics.
- It favors asynchronous patterns.
K.I.S.S.
Don’t mix trying to learn JavaScript with trying to learn a framework or library. My initial attempt to learn Ruby was thwarted by Rails. I know that some folks will disagree with me on this point. Here are my reasons:
- It’s likely that you’ll encounter many new concepts just learning the language.
- Sometimes it’s difficult to discern between a language feature and a framework feature.
- Many frameworks embody an opinions that can (unintentionally) mislead you about the language (e.g., many frameworks attempt to make JavaScript classy).
Now, having said that, I do recommend exploring the vast diversity of frameworks and libraries out there after you’ve become comfortable with JavaScript.
Some Resource
JSHint a community-driven port of the aforementioned JSLint. It’s groovy. There’s an extension for Visual Studio 2010. I also like to use it with the sublime Sublime Text 2 by way of the the SublimeLinter package.
jsfiddle and jsbin are two cool little online playgrounds for sharing bits of JavaScript.
NodeJS can be very good for playing around with JavaScript. Be careful though of trying to learn all about Node at the same time. Here’s a Windows-friendly quick start.
What else can you add?