usaygw
Last Updated: February 25, 2016
·
2.716K
· sagish
Untitled 4

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

Firstly, and most importantly for me, I really love Javascript. It’s the first web development language I learned as a teenage web junkie, and it’s has been following me throughout my career ever since. Being a mostly client-side language at the time, JS and I swiftly became good friends. I know, and you don’t have to spell it out for me, it has all kind of flaws. Some of them are even ridiculous, but you can surely understand my excitement in this case when Javascript was introduced by Node as a backend web server, making it now possible to compile a complete project with just one programming language, share modules, enjoy it’s flexibility and quickly enhance it’s open source community. Although by that time I felt comfortable enough with both PHP and Ruby, these new options were undeniably appealing. But not only them.

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.

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.

My Precious

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).

Continue reading:

Node for Rails developers: using Compound.js

Say Thanks
Respond

3 Responses
Add your response

9724
Icflorescu

Excellent writing, Sagi!

It seems we share the same passion and views on the Node.js environment; I wrote a similar tip a few weeks ago - please have a look at it here: https://coderwall.com/p/diokxg

I also loved your take on simplicity - people having "a fetish for keeping web-apps as simple and as lightweight as possible" are, unfortunately, a rare breed nowadays :-).

Actually, I think its core simplicity is one of the reasons I've come to enjoy working with Node.js so much.

As the headline on nodejs.org says, "Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications." What it doesn't say is that, when you have such an excellent foundation for speed, an entire exploding community will start building useful features and functionality around that core.

In my opinion Node.js doesn't need a silver-bullet like Rails. Express and the other existing frameworks are powerful yet lean and flexible enough to leave room for innovation on individual projects. I'm an adept of simplicity too, and I'd rather start building my projects by adding the necessary features than by removing the unneeded ones before anything else :-).

Thanks for writing!

over 1 year ago ·
9743
Untitled 4

Thanks, we do seem to be in agreement :-) despite Node might not needing a silver bullet, I would like to see the community join efforts and scatter around less. It is nice to have the diversity on one hand, but on the other this scenario will lead to a lot unmaintained, out-dated and neglected packages in the near future

over 1 year ago ·
9764
Icflorescu

"Node itself is not even at 1.0, not that it lets anyone disregard it, but it needs mentioning."

There's also a catch here: Node.js doesn't follow the "accustomed" version numbering pattern. I know it's like comparing apples and oranges, but I'd dare say that, now, at v0.10.20, Node.js is a lot more mature than .NET Framework at it's 2.0, and more "in tune with the web" than .NET at 4.5 :-).

over 1 year ago ·