Six Reasons Why node.js Is So Popular
Node.js is an interesting new phenomenon to hit the web development scene lately. Many things can be said why it has become so popular. Below is a small list compiled of different aspects with node.js that, at least I, believe has contributed to it’s success.
1. It’s fast
Being built upon on the V8 VM found in Google Chrome, node.js offers extreme performance compared to similar VMs used in Ruby or Python. In benchmarks, V8 is outperforming CPython by a factor of ten. Such microbenchmarks might not always tell the whole story but it’s a clear indicator of how fast V8 is. With differences like this, performance becomes a feature!
2. JavaScript all the way, baby
JavaScript has truly become the ubiquitous language of the web. Everyone doing web development (with or without node.js) knows JavaScript. This not only helps drive adoption but also makes it easier for code re-use between front-end and back-end.
But a more important point is that this helps reducing the cognitive load that a web developer has today. Reducing the number of languages and [unifying parts of your toolkit] does a lot for your productivity. Even databases such as CouchDB and MongoDB are using JavaScript for controlling behavior. Being so widespread, it’s possible to use JavaScript through all three commonly found layers: browser, server and database.
3. Web centric
Being based on JavaScript and V8, node.js has naturally come to attract mainly web developers. In spirit of the Python Paradox, it has also come attract very talented developers. Many responsible for interesting innovations within the web development community lately. Two examples are socket.io and SocketStream.
A common opinion is that Ruby (with Rails) used to be the go-to language and platform for web dev hipsters but this seems to be shifting towards node.js. This is also reflected in the number of node.js libraries available as they tend so solve very web specific problems.
4. Active development
node.js is a young project. It hasn’t even reached 1.0 yet and APIs are continuously being stabilized. This has of course both benefits and drawbacks. But with the fast moving web development community, this has the potential of being favorable to those people as features and decisions can be made quickly.
Node.js is currently the third most watched repository on GitHub making it a very popular project. The only two more popular projects are jQuery and Rails. Another interesting aspect with node.js is that it uses an existing VM and an existing language (all node.js really does is providing an async I/O layer on top of existing software).
5. Always asynchronous
All I/O done in Node is by design asynchronous. This is a very deliberate decision made by node.js’ author as it’s a very opinionated platform. JavaScript has a long history of being used in event-driven environments (read: browsers) because it’s syntax, closures in particular, fits this development paradigm well.
Being 100% asynchronous with only ONE true way of doing I/O also brings other benefits, as seen in next section.
6. Non-fragmented community
Perhaps the biggest reason why node.js and it’s event-driven style of programming has become so popular is the fact there’s only ONE way of doing I/O. This has tremendous implications on the community as it can be centered around one I/O API.
This very fact is also the reason why evented programming never has taken off in other similar languages such as Python and Ruby. While they both offer many event-driven and asynchronous I/O frameworks they all suffer from one thing: community fragmentation.
This is devastating to adoption since every framework found in these languages form their own communities with libraries not compatible with vanilla I/O shipped with the platform. While great implementations, popular examples are Event Machine, Twisted and gevent. Although gevent tries to alleviate the problem slightly by monkey patching existing I/O functions.
With node.js approach of being ONLY event-driven right from the start it avoids this problem completely.