3 ms·
This seems like trolling more than a genuine question, but I'll answer in case it is genuine. It makes it easier for fullstack developers since it's a single l
by franciscop 6y ago
This seems like trolling more than a genuine question, but I'll answer in case it is genuine.
It makes it easier for fullstack developers since it's a single language both in the front-end and back-end. You only need to learn once how `JSON.parse()`, `atob`, classes/prototypes, etc. work, and not worry about language inconsistencies making errors.
It is decently efficient (not the best, not the worst), fairly readable (I'd say on the upper side). The three main disadvantages IMHO are:
- Its async nature is more difficult to grasp for beginners compared to one thread/request and then linear-ish work of some other languages
- Node.js standard library is optimizing for flexibility instead of conciseness or completeness, so there's quite a bit of manual gruntwork involved (not the worst of those mentioned though).
- Right now the ecosystem is in a major migration from `require()` to `import`. The last large migration like this was from Callbacks to Promises, and IMHO it went very well.
As someone who is very comfortable with Javascript, and was comfortable with PHP and Python back in the day, I would not trade Node.js for any of those. I am thinking most of the time about what I want to achieve in a coherent way, and not fumbling with pointers.
- mekster 6y ago> - Its async nature is more difficult to grasp for beginners compared to one thread/request and then linear-ish work of some other languages Grasping isn't the hard part, it's just about placing callback functions on executed functions that allows callbacks. What's so bad is that it is async by default and now you need million "await" and "async" keywords all over the place. I wish it would be sync by default and for those rare cases where you really want it async, you would add a keyword.
- franciscop 6y agoI mean 4 of the very common Node.js operations are async by nature: database calls, file access, external API calls and crypto.
- dragonwriter 6y agoThey aren't async by nature, just time consuming. Async is a useful way of dealing with time consuming operations in some situations, but blocking calls also a work (and make more sense for some workloads.)