New Software Development Technologies, New Possibilities: Node.js

288 Image

New software development technologies are constantly emerging and one of the most exciting new ones is called Node.js. It is a software framework (based on the Javascript language) that can be used to develop and deploy custom network applications. It allows running Javascript as native code at server-side making it a very fast, lightweight and scalable framework.

Node.js uses the Google V8 engine to compile high level Javascript code directly into low level machine code. The benefits of doing this are its speed and that it is asynchronous. This means that your code can be designed to execute tasks that are not dependent of each other or must wait to see which finishes first. While it can be used to create any type of application, it is most convenient during web based development.  It can be applied to create a more engaging, real-time web application while diminishing requests to a server and make it more responsive.

A good example of this would be a HTTP server application. Node.js provides countless libraries in order to develop your application. With only a few lines of code you can create a very simple HTTP server:

var http = require("http");

http.createServer(
  function (request, response) {
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.write("Hello World");
    response.end();
}).listen(8080);

In the previous example, when a user opens the webpage “http://localhost:8080/”, he will be treated with a page containing the message “Hello World”. While this can be done in any type of server with a simple HTML page, here we gain more control of our server and the ability to be asynchronous. It can handle the request for the user and route it accordingly based on your own rules. You can limit the traffic to the user and the response he gets directly into the code. It can push new events or notifications to the user without hitting the refresh button, thus eliminating the need to be constantly making requests to the server. Basically, you can tailor fit how the server is going to work based on your own specified needs. This makes it more efficient and eliminates tons of overhead.

Since it is built on Javascript, the programming learning curve is very low. You don’t have to be an expert on Javascript, or programming in general, to be able to create your own application. Big name companies (like Yahoo, LinkedIn, and Microsoft) are already aware of this and are deploying Node.js in their production environments. Since the web is moving to one based on instant feedback, it seems to be the perfect framework to use for development.

For more information on Node.js, as well as a tutorial, you may visit NodeBeginner.org and Nodejs.org for the installation client.

 

Have you used node.js before? Did you find it useful? Let us know what you think about it!

 

1 Comment
  1. Robert Lozano

    Nice intro, I’d add that because it is event oriented instead of object oriented, code is non-blocking (asynchronous like you already mentioned). Code generators let web developers code without having to
    do boilerplate code and having to follow modern best practices. Javascript in both backend and front-end is still daunting and a big challenge for object oriented programmers who are used to having intelligent IDE’s for mature developing frameworks like spring, .net etc.

    Reply
Wovenware Gravatar
  • (will not be published)