- Skill reuse. Developers only have to learn a single programming language that they can use for both client and server-side programming. Front-end developers can leverage their existing skills to build server applications too.
- Code reuse. The opportunity to write your code once and be able to run it on either client or server, opens up great opportunities. The most obvious example would be reusing code to validate forms, which you have to do on both sides anyway. But there are many more exciting opportunities to be explored, e.g. the ability to dynamically decide where to render your UI (client or server, or a mix) based on device capabilities.
A New Hope
This has two advantages: it avoids concurrency issues and it supports the construction of super efficient high-performance servers.
Programming with threads is hard. Very hard. When things happen at the same time concurrency bugs can occur easily (e.g. two threads modifying the same piece of memory simultaneously), which are incredibly difficult to reproduce and fix. Courses are taught at universities to teach students how to avoid concurrency problems using locks, semaphores etc. Concurrency is difficult, it’s best to avoid it when possible — Node.js enables you to avoid concurrency by not supporting it at all, at least on a process level. In a Node.js process, only one thing happens at a time.
Servers built with Node.js are typically super fast and can handle thousands, tens of thousands, even hundreds of thousands of concurrent connections — something very difficult to achieve with threaded servers. How can that be?
It’s all based on the observation that server threads in typical web application servers spend most of their time doing nothing — just idly waiting for the result of a database query, waiting for the disk to spin and return a file that’s requested or waiting for data to come over the network. For every single connected client there’s a thread just sitting there, idly, using up resources.
The Node.js Community
The Node.js community has been growing rapidly over the past years. More and more companies build their servers with Node.js, especially for servers that require real-time communication and therefore have to handle a lot of simultaneous connections. As the real-time web grows, so will the use of Node.js.
Therefore, it is time to make Node.js more accessible to the developer community. To do this, Node.js needs a few things:
- Good documentation
- A community website with in-depth articles and tutorials
Using Cloud9 IDE you can try out and play with Node.js without having to install anything. You can create Node.js projects, run, debug and deploy your project right from the IDE.
In collaboration with partners in the Node.js community, we are now launching three more initiatives:
- Nodebits.org is the new community website for Node.js developers with the latest news, in-depth articles and tutorials.
- NodeManual.org is the new one-stop source of Node.js documentation. The MDN of Node.js development, if you will.
- Training provides three-day Node.js training courses for the enterprise.
Any example code used on Nodebits, NodeManual and our training material can be run in Cloud9 IDE with just a click of a button, lowering the barrier to try out the examples even more.
About Robert Nyman [Editor emeritus]