Node or Not

Front-end web technologies are maturing at a break-neck pace.  It’s hard to keep up, to manage versions and dependencies, and stay abreast of the latest best-practices.  Heck, it’s hard just getting stuff to work correctly without having to go off-roading through someone else’s github repository.  But luckily, there’s a back-end framework that manages all that front-end stuff effortlessly.

The other day I mocked up an administrative web dashboard using the rdash framework.  It was quick and easy- I slapped some dummy charts on it, filled in some Lorem Ipsum and showed it off.  It took only a few minutes to get all the frameworks in place; Angular.js, D3.js, Bootstrap, and a whole host of others to glue it together.

Then the cool part started.  As I was showing the mockup to a coworker, I made a change to the code- and the web page automatically refreshed with the changes in place.  I had served up the web app using gulp.js, which watched the local file system for changes, rebuilt the entire app, and sent a message to the browser to refresh itself.  My coworker exclaimed that it must save a lot of time, not having to save, build, and then refresh for every change.  Yes it does.

All made possible by node.js.

If you’ve paid any attention to the web and software development world in the last couple years, you’ve heard about node.js.  You’ve probably even seen the blog posts about what it’s good for and what it’s bad for (video).  The whole conversation has become stale, so let’s ask a better question: should you use node? If you’re a developer, Absolutely.  But maybe not for what you think.

The reason my mockup took a few minutes to build and demo instead of a few hours (or days!) was due to Node’s built-in package manager, NPM, along with the Bower.js front end package manager.  Don’t get too bogged down in acronyms here, because what’s actually important is that I used Node as a development tool, not as a platform for the software itself.  Yeah, that’s right, the finished web app doesn’t include Node at all- it was built with it.

Node can do a lot of stuff.  Most conversations about Node center on how it performs in production, how hard it is to get experienced developers, or even just opinions on the qualities of the JavaScript language.  But most of those miss the point: it’s a tool, not a religion.  And tools can be mixed and matched to serve the needs of the programmer.  So pick the things Node is good at and run.  Dependencies can be managed, stylesheets and JavaScript bundled and minified, the whole thing wrapped up and put into a folder, ready for delivery.

The cost for all that convenience and power is a learning curve and, for some of us, taking on our pre-concieved notions about JavaScript.  But that’s a cost that’s built into being a developer, and for me, one I’m happy to pay.

Submit a Comment

Your email address will not be published. Required fields are marked *