James Strachan on evaluating Node.js

Node.js is an often debated new programming language. In this video James Strachan gives his advice on whether or not to use Node.js for a given project.

While some developers have found that using Node.js simplifies their code and adds significant time and cost-savings to their ongoing projects, other developers say "Node.js is stupid."It stands to reason that if a programming language is loved by some and hated by others that it probably does some things very well and other things very poorly. The trick for senior developers and software architects is to understand which projects will benefit from a new system like Node.js.

To learn more about the best use cases for Node.js, we talked with software development guru James Strachan. Please enjoy this short video. A full transcript of the video is included below, for your convenience, as well as a brief biographical statement about Strachan.

Javascript has been such a success story that some have asked "Why just on the client? Why not use JavaScript on the Server?"

I think a lot of us old Java guys have to get out of the habit that everything's on the server now – in many ways – everything is on the client. In our day, there wasn't really that much on the client. Well – going way back everything was on the client – but then it moved over to the server and now it's sort of coming back to the client again – or most things are.

The server side is becoming thinner and thinner. The server side might just be Amazon Simple DB or Mongo DB or something; there might not be much of a three-tier architecture anymore. But the client side is becoming bigger and more and more complex; it's real-time now, everyone's doing Ajax, real-time updates, and people are doing lots of single-page applications – which is one Web page starts up and the entire app is in there. There's lots of models, containers, relationships and persistence and yada-yada. So JavaScript is really where the action is in terms of the platform.

In many ways the browsers won. Almost every mobile platform has Web capabilities inside it – Android, iPhone, iOS all have Web browsers and so forth. So the Web has kind of won, but most browsers use JavaScript and HTML 5. Silverlight's dead, Flash is kind of dying, user interfaces now and going forward – the browser is really where it's at with HTML and JavaScript.

Tangent to this is, everyone is compiling JavaScript to something else – even the JavaScript programmers. Nobody writes JavaScript and deploys it into production. You compile it into something. In development, even if you're using JavaScript, you combine it into a minified, combined single java script file. You might have a hundred JavaScript files and libraries and modules and you compile it all into one minified file. So everyone's compiling their JavaScript, even the JavaScript folks, right?


Minified. Or encoded or what-have-you – you've got to use JSLint because JavaScript also has bad parts – and so forth. A really good alternative to raw JavaScript is CoffeeScript which really is a pretty beautiful language. It's dynamically typed. But apart from that, it's a really nice language.

Personally – if you're doing a smallish implementation, dynamic typing is kind of fine, but when you get into huge scale – I'm a static typing kind of guy. When I'm working on a big application/project/code base, I find that the benefits of static typing and navigation and refactoring add a huge amount of benefits to maintain the software.

So the question I'd like to ask is – now I'm envisioning an application development manager that has a great development rock star come in and the rock star wants to do Node.js for the server-side thing – how does that manager figure out if it's wise or not?

If you're writing lots of JavaScript on the client, then using JavaScript on the server makes total sense. Node.js makes total sense to me; it allows you to do lots and lots of JavaScript on the client, reuse it on the server, the server is often fairly small because all the work is being done on the client. You're often doing all your templating and rendering on the client side because it's Ajax, it's all realtime now, so the client is doing templates and rendering, but sometimes you do some on the server, although not so much these days. So it makes total sense.

So that's what I should do…

Well, if you're programming in JavaScript, Node.js makes perfect sense, but the question is "Are you actually programming in JavaScript?" Is JavaScript just an output format, or is JavaScript actually a considerable part of your source code?


James Strachan is the inventor of the Groovy programming language and an avid learner and tutor when it comes to new programming languages. He is the co-founder of ten different Apache projects including Scalate, ActiveMQ and Camel. Strachan is a software fellow at the open source middleware company FuseSource, which was recently acquired by RedHat and will continue to run alongside the existing JBoss projects. This video was taken at the recent CamelOne event which happened in Boston before the acquisition was announced.

Dig Deeper on Software programming languages

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.