3 ms·
Is the best reason to use Node.js really just that it supports asynchrony? I'm sure Go also has that and Erlang has existed for a long time. There are many othe
by tshadwell 13y ago
Is the best reason to use Node.js really just that it supports asynchrony? I'm sure Go also has that and Erlang has existed for a long time. There are many other options, so why Node?
- demands 13y agoNode allows you to write JavaScript on the server, which is pretty awesome if you're interested in sharing code (validation, etc) on a client-heavy web app. I don't have any experience with Go or Erlang, but Node's particular brand of asynchrony is all about non-blocking IO. There are no threads -- all instructions happen in one thread.
- city41 13y agoNode came at a time when client side JS was really starting to take off. I can't speak much about Go or Erlang, but I suspect a lot of it has to do with marketing and some lucky momentum. It also helps that tools like Grunt are Node based, causing frontend devs to look to Node when they need to stand up a back end. At least, Grunt was a pathway into Node for me anyway.
- stewbrew 13y agoThe way I see it, go & erlang is rather about concurrency (and parallelism). async the node way is single threaded. Anyway, the reason probably has rather to do with JavaScript (V8's speed) and node's eco-system (tools, libraries).
- rads 13y agoSome advantages: - Yes, built-in async support is very important - Everyone has to write JS at some point anyways -- it helps to take advantage of what everyone already knows - You can easily share code between the client and the server - There are tons of modules available on NPM already - The compile-to-JS languages are getting more practical every day, and you can integrate them with existing JS code If you consider time spent learning a platform compared to what you get out of it, Node.js is probably the best bang for your buck today.