Node.js is My New Favorite Thing Ever

When I first heard of Node.js I thought it was a terrible idea. "Javascript on the server-side?? That's madness!" Well, "Sparta!" I say to you because Node may be the best thing I've discovered for web development so far. Node is so amazing because it allows you to use the same language everywhere without having to use one specific framework or other non-standard non-global language. In fact, if you add in a javascript-based HTML templating language like Jade(my other new favorite thing) You can write javascript for everything but your CSS. For which I strongly recommend SCSS and if you're like me and you really love clean syntax, go for SASS. Just to get everything as clean and simple as possible you could also write your application using Coffeescript effectively eliminating all excess markup from your workflow. I find that to be a beautiful thing.

I only started learning about Node recently and I had a use for it almost immediately. I needed to build an ad server and quick! I didn't really need all the power of WordPress which was my go-to for pretty much everything. I just needed a simple application with user authentication, a few data types and some data sending and storage capabilities. I turned to Node because I knew it had the capabilities and writing out a full application with PHP + MySQL seemed like it would take too long. The most powerful thing about Node is that it's not just an application framework, it's also everything else down to the most basic functions of a server(for context, lets just say that express.js is basically a given in any web app based on Node so it might as well just be part of it). Using Node and NPM I could quickly whip up the basic application framework by require-ing things like Mongoose(MongoDB), Express and Passport. From there, it was a hop and skip(no jumping required because even the database uses javascript and JSON so I already knew how to use it) to get my application running. Unit testing in javascript is pretty straightforward so I handled most of my testing quickly as well. I used Heroku for hosting so there was very little effort in delopying and configuring my application's hosting. I'm also eyeing nodejitsu as an alternative because of what I've read about their stack and their amazingly low prices.

I was wary of performance before I started, thinking that Node could never achieve the speed of a "better" server/web app framework. Well boy was I wrong! This thing is speedy! I've never written an application and gotten such good performance out of it. Even WordPress run locally on MAMP seems a little slower than it should be to me but I just chalked that up to bad configuration or something. This is different. Node responds to my requests locally immediately and with no noticeable lag whatsoever. Run on Heroku, I sometimes notice a tiny delay maybe but never anything substantial. I'll be learning Rails next for work but Node.js may continue to be my not-so-secret lover for a long time. If you're a web developer and you don't know about Node, considering taking a look at this setup (node, mongodb, coffeescript, sass, grunt or CodeKit for automation). I think you'll appreciate the beauty of it.