Esquire Theme by Matthew Buchanan
Social icons by Tim van Damme

hit counter
hit counter

29

Jun

What are the disadvantages of using Node.js?

Answer by Alexander Gugel:

  • Callback Hell: Everything is asynchronous by default. This means you are likely to end up using tons of nested callbacks. Nevertheless, there are a number of solutions to this problem, e.g. caolan/async or Understanding promises in node.js. This problem is specific to JavaScript, not Node.JS.
  • Single-threaded: Node.js is single-threaded. You can take advantage of multiple CPUs, but in general everything is designed to use the Event-Loop in order to achieve extraordinary performance. This can also be an advantage, since e.g write conflicts on files aren’t that relevant.
  • JavaScript: There is a reason why is it called Node.JS. JavaScript has been designed in 10 days and that’s partly obvious. I really like JS, but there are some obvious drawbacks (but every programming language sucks, just read YourLanguageSucks - Theory.org Wiki). Prototypal instantiation wasn’t originally planned to be integrated. Prototypes are much more elegant, but since Netscape wanted to jump onto the Java-train, they wanted to introduce the new keyword.
  • Event Loop: The Event Loop is the core of Node.js and it’s a genius idea. But: Don’t use Node.js for blocking, CPU-intensive tasks. Node.js is not suited for stuff like that. Node.js is suited for I/O stuff (like web servers).

TL;DR
Don’t use Node.js for CPU-intensive tasks.
Node.js rocks for servers.
JavaScript partly sucks. Use CoffeeScript in order to solve this problem.

Node.js certainly has some disadvantages, but it is currently one of the best tools out there in order to create asynchronous, non-blocking apps. It’s great.
View Answer on Quora