I’ve been learning a new programming language the last few months, for the first time since the summer of 2009 when I spent a few months dabbling in Python. This time it’s Node.js, the popular new environment for writing high-performance internet applications and web servers.
If you’ve not heard of Node (I’m looking at you, Mom), you’ll probably want to stop reading at this point and go look at pictures of our dogs instead.
Here are a few of the resources that I’ve found useful for learning about both the syntactical and philosophical aspects of Node …
First off, if you don’t already have it you’ll need to install Node. You can find all the latest versions and instructions for the (extremely simple) installation process on the Nodejs.org web site. A note for Windows users: if you see references to running Node under Cygwin, that’s the old unsupported approach. Now you can simply install Windows binaries from Nodejs.org, no Cygwin required.
An important resource to know about is the documentation on Nodejs.org. Documentation is available for many different releases, and you can see all of the versions on this page. Note the link at the top of that page to the latest version. That’s what you want if you’re new to Node, and you need to be careful when you follow links that other people provide to documentation of Node APIs. Some people have hard-coded links to specific versions of the documentation (I’ve seen a link to version 0.6.0, for example), and you can waste a lot of time trying to debug code running in version X while you’re referring to documentation of an incompatible version Y. As long as the URL has docs/latest in it, you can be sure you’re looking at the documentation for the current release.
After you have Node installed and know how to look things up in the documentation, it’s time to learn a bit about how to use this shiny new tool in your toolbox. Node is great for some things (real-time web apps, single-page apps), but it’s not for everything. You can find on Youtube a good video overview from Ryan Dahl, the inventor of Node.js, that can help you understand the thinking behind Node. Mikeal Rogers also has a well-known post on “The Way of Node” that outlines a set of guiding principles for Node developers. Another outstanding resource is HowToNode.org, which is run by Tim Caswell, community manager at Cloud9.
Finally, one other resource is not free, but I’ve found well worth more than the $7.99 cost: the Node.js Bundle from LeanBundle. Both books are provided in PDF and Kindle format.
For an old-timer like me (let’s just say I still remember the buzz of Fortran-77 being the shiny new programming language), there are some things to instantly love about Node. Installation is fast and simple (and free), and the Node interpreter is a single executable that you can fire up and immediately start typing statements in a command window (or REPL). You can also type Node myprogram.js at your OS’s command prompt to run your masterpiece. I have Node installed on my Windows, Mac and Linux machines, and the development experience is roughly the same on all three. Well, different text editors of course, but that’s a whole other area of passionate disagreement among developers so let’s not go there today.
I have asserted here that Node is fun. I’ll try to back that up with a few simple code samples in my next post.