The Benefit of Node-First Development

This summer I started working in a big company, a really big company! I don’t want to say any names, but I’ll disclose the initials: I B M.

As part of my first project, I needed to understand how an existing tool worked, and then add features to it. I quickly discovered that this was a more significant task than it seemed; unfortunately, it was down to my ineptitude at Java rather than the complexity of the problem at hand.

In order to gauge the difficulty of the problem (and to think about a good method of solving the task) I wrote a prototype in JavaScript. This was 90% functional in 3 hours and about 40 lines of properly async code. I then switched to Java. Two weeks and about 1000 lines of code later, I managed to bring the Java version of the code to about 95% completion. Admittedly, a decent amount of time was spent remembering how to Java, and learning how to integrate my program into the Ant build script that was part of the existing program.

… writing in JS is akin to writing Pseudo-code, but it actually works …

So, why am I telling you this? What did I learn? Well, I learnt that if the task at hand allows for it, I’m going to write a proof-of-concept in node.js long before writing any Java. Although the languages are very different, having a functional prototype in one language is a really good way to think about how best to approach a problem. Additionally, it’s really good practise to learn (and remember) what the conversion process from JavaScript to Java is. Continuing to improve my JS skills is always a good idea, and most importantly, it’s much much easier to re-write a line of JS than it is to re-write two hundred lines of Java.

The benefit of node-first development is that you can solve the problem coherently in practically no time and no code. For me, writing in JS is akin to writing Pseudo-code, but it actually works, and isn’t this nebulous nonsense. Node.js let’s you write pseudo-code-style by abstracting everything away into modules. re-usable modules!

At least, that’s my excuse!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s