Intro: Why I chose Node.js over Ruby on Rails
After a period of web development using PHP and later on Ruby on Rails, I have decided to put all my eggs in Node.js basket. Here’s why.
First a disclaimer: this title isn’t meant to ignite flames. It’s just my subjective point of view based on my personal experience. Like a lot of people, I have been enjoying web development, front and backend, for a couple of years now. Backend-wise I started off with ASP somewhere in the early 2000's, and later on moved to PHP and then to Ruby on Rails (3) by 2010. Now I have settled on Node.js and I finally feel at home. Here are my reasons why.
One Language to Rule Them All
Keep it Simple, Keep it Fast
I have to admit it. I have a fetish for keeping web-apps as simple and as lightweight as possible. Sometimes at the price of ridding off fancy front-end enhancements, sometimes at the price of dismissing resource-expensive packages or frameworks on the server. I always recommend my clients to keep it simple and lean, not to say minimalistic. The site you are reading this post in is a good example.
So, to further fuel my enthusiasm, Node.js has brought along with it a couple of characteristics I felt mesmerizing. Firstly, based on Google’s V8, it was blazing fast. You could feel it instantly, locally (as part of TDD) and remotely, other stacks just didn’t compete. I won’t diss other environments (I have the utmost respect for each of them), nor begin a configuration discussion but just approach it as is: in it’s category, Node is really really fast. Moreover, and even more importantly, non-blocking I/O was just spot on maximizing CPU utilization and ridding off known bottlenecks, leading the way to a excellent performance handling a vast array of concurrent connections and runtime sockets. I knew it was home run (also see “What is Node.js” on StackOverflow).
I Come to you at the Turn of the Tide
But not everything is shiny and dandy, of course, and that has to be said. Mostly, for now, the feeling is although Node’s community is spreading and growing immensely, it’s still not as mature as other communities, Rails’ for example. Node itself is not even at 1.0, not that it lets anyone disregard it, but it needs mentioning. And although the community has widely adopted the robust Express to be a fundamental scaffold in most projects and packages, there’s still a big debate and confusion on to which would be the next ultimate framework that allow cohesive MVC or Realtime development. There are a few runner ups (a great list could be found here, my personal favorite being CompoundJS), but all-in-all efforts are being scattered around, and while it has some advantages like a wide variety of NPM packages to choose from and the opportunity to compose your own ideal stack, some unity is somewhat lacking.
I enjoy developing in Node, and I know I’m sticking to it. I knew it from the first time I laid eyes on it, or wrote my first asynchronous I/O backend function. This was just a brief overview of little of my most immediate insights when it comes to this topic. I could, and I would, elaborate in the future about other great assets provided by Node and it’s diverse and active community (like Grunt, Moment.js, MEAN.io and many other powerful tools).
In my upcoming posts I will also discuss the beauty of CoffeeScript turning “callback hell” into callback heaven (especially comfortable for RoR developers), reasons why I chose being a freelancer over a full-time employee and it’s pros and cons, and why front-end development is (now) harder than backend development. Stay tuned.