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!
3. Web centric
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
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.