Node.js: Simply Awesome
I’m one of those guys that get fired up about new shiny toys every now and then. And the latest shiny toy is Node.js. Aaah, shiny! A few years of web development experience behind me now allows me to make a slightly more informed opinion, however, and I would like to share it here with you.
First of all, what is Node.js anyway. I remember the weird experience I had when I first saw Node.js. To be more precise, the weird experience of seeing its homepage for the first time.

I knew JavaScript only from my brief occasional skirmishes with jQuery a year or so ago, and seeing a completely different face of that beautiful language (as I come to realize) was nothing short of shocking. The dark background reinforced the feeling that I was starting at what seemed like a portal to a completely different word. And the tag line “Evented I/O for V8 JavaScript” did not help to repel that feeling.
I was looking at Ruby on Rails, secretly contemplating using it for my next project, when my dear friend and mentor, Dusty Phillips, recommended for the second time that I look at Node.
Dusty was also responsible for my first eerie encounter with it. Since then I’ve tried to use it only once but gave up after a short while. I was in desperate need for something new, though, so I decided to try it. And I fell in love with it immediately.
What node is and what it is not
Node.js is not a web framework. It is a non-blocking platform for building networked applications built for the V8 JavaScript engine. I hope this mouthful covers what it is.
V8 is the JavaScript engine that gives Google Chrome its wheels. In the words of Ryan Dahl, the principal architect behind Node.js, it was built “very professionally” by some “very smart people”. It poses a performant and solid base to build on.
Node.js is a set of libraries for building non-blocking networked applications. Non blocking means that you cannot halt its execution for any reason except by breaking your application. Even when you have to wait for a remote host to respond to your HTTP query, your software will go on executing the next statements. And there’s no sleep statement. Because this is JavaScript, it means you will handle any kind of waiting by means of callbacks.
Because it is non-blocking, Node.js can handle requests rapidly while your application is idling, waiting for something to happen, be it completion of database operation, or response from a remote host. Despite the fact that JavaScript applications are single-threaded, this gives Node.js-based applications extreme responsiveness. This is something that is also done on platforms like Google App Engine (you’ve surely heard of ‘asynchronous Puts’, if you have used it). On GAE, you probably only hear about these things, and rarely use them directly. On Node.js, that is part of everyday life. Everything is asynchronous: you cannot pause, or stop, you keep on going and going and going.
As for the networking part of the deal, Node.js is built for creating networked applications. It’s main scope is TCP, HTTP, and similar low-level communication. It has libraries for creating and using sockets, and you can easily build a web server on it. With special emphasis on ease. How is this useful to a web application developer, though?
Thanks to the fact that the language it uses is one of the most prominent languages in web development world, and thanks to its ease of use, some very bright programmers have gathered around Node.js and started building bits and pieces that made it one of the most convenient application servers around.
Nowadays, you will find extremely well-defined web frameworks, libraries that would take care of most common tasks (databases, authentications with OAuth support, crypto, and the list goes on). The NPM, Node package manager, puts all of this firepower at your fingertips, and from what I’ve seen, there is very little fragmentation in the Node.js scene. Even Node hosting providers will make their tools available from npm, so if you develop with node, you will usually be able to deploy a Node application in a few keystrokes, literally.
All in all, I’m very excited about Node. The first steps have been successful so far, with the exception of MongoDB-based authentication with mongoose-auth.
Where to start
So let me give you a quick overview of various places you want to be aware of if you want to give Node a try.
First and foremost, know your language. Check out papa Crockford’s excellent talks on JavaScript (there’s a total of 6 of them, and they are well worth the watch).
Secondly, you want to grab the source from Node’s homepage, and build it yourself. Most packages out there, save for systems like Arch Linux, are usually very outdated, and Node keeps evolving fast.
Keep Node documentation under your pillow.
Be sure to watch the introductory video (1 hour) to find out what Node is about:
Check out Express framework, very powerful, and beautiful framework that looks a bit like Sinatra. And of course, watch Express screencasts.
Browse through the list of Node modules. You will be surprised at the number of modules that are not only build for Node, but also provide hooks for integrating into Express applications.
You may want to browse through screencasts on Nodetuts. So far, 24 episodes have been published there.
Happy hacking!




