Why You Should Learn – Node.JS

When I was in my higher math classes I was irritated. Some goofball with a powdered wig and a ton of time on his hands got drunk and poured Calculus into my Computer Science! I was appalled, considering so few of my work colleagues were using integration or derivation in their day to day, I found it incredibly difficult to accept that it would be useful in my day to day. All of this fell apart when I was tutoring algebra and heard the same damned arguments, and realized that I was in fact a fool – about that one thing in particular.

Over the years a number of languages have come and gone, allowing me the opportunity to learn them and leave them (Java, Ruby, Squirrel) but a few have stuck around proving to be quite useful, interesting and all around insightful in spite of time doing its best to wear them out (C, C++, C#, Scheme). Node happens to be the next evolution of JavaScript, a language that falls into the later camp.

Overview

Node.js (or node for those of us on the inside lovingly call it) is the platform that brings JavaScript, via the same Chrome V8 engine that you are already in love with if you are browsing the web, to the server. JavaScript has been around for twenty or so years, irritating everyone with its all around misuse and security issues. Similar to Perl, Python, … oh yea – every other language known to man, when people who don’t know the language try to solve problems in it wrong it looks ridiculous and horrible. Bringing paradigms and methodologies from other languages is rarely going to pay off when you find your way to the bottom line or compiling it out.

All of that said, Node is an expansion on the ECMAScript standard, adding modules and a few other bells and whistles to make Node not only a viable alternative to any other scripting language, but to ensure that it is expandable so it doesn’t get stagnant.

Why is it Important?

This is a completely valid question, because as I mentioned, other languages have come and gone. Node is a platform for JavaScript that presents it as a C derivative syntactically, but screws with your brain by introducing you to asynchronous and event driven programming, all while forcing yourself to work in a lisp or scheme like world. With all of that going on at once it is easy to get lost, but it is also provides a solid place to learn all three of these things with little overhead and theoretical cross platform support!

Most developers out there are willing to admit that asynchronous programming is one of the most complicated concepts to get your mind wrapped around. Functions being higher order types and being able to leverage prototypical inheritance is a breath of fresh air, but not because they are inherently going to stomp on all OO theory as we know it, or because they are going to solve some world conflict. The concepts are all important for the same reasons Calculus was important in my CS education – because they help you think in different ways.

Suggestions

When you are first learning PHP, you have to build yourself a blog or you are doing yourself a great injustice. Building it allows you to work with a database, HTML, JS and probably some form of formatting, so you get to exercise some of the tools that your PHP-Army knife provides and get your feet wet. With Node much of the same is still true, but more impressive because while PHP is a web programming language stapled to Apache or NginX, Node is a real change up, because it does not rely upon apache or NginX to do anything. It comes with modules that allow you to build application of most any kind, so really your Hello World application may be anything.

That is not to say that Node is not at home in the world of browsers and internet explorers. For web programmers you will be quite happy to know that Express exists. Of course you can dive directly into HTTP if you insist, but why reinvent the stick if you already have a pneumatic hammer?

For game developers, you will be happy to hear that OpenGL bindings are in development and are actually available to play with and or break. Node has the ability to be bound to any c library, given that you have the drive to maintain it until it becomes popular enough to use.

Threading is another field gaining traction in Node. Initially it was a topic that was consciously avoided, but who knows what the future holds. For anyone else who wants to do something interesting and doesn’t know where to start, you may want to look into the cloud packages or maybe you are interested in Hadoop.

The point is, Node is presenting one of those opportunities that only comes once in a while. It has the flexibility and fluidity to operate in most any environment (did i mention Linux, Windows and MacOSX builds are already available?) like python or java has provided in the past, with a new set of methodologies that leads you to the ability to solve problems in a different way.