3 ms·
The real surprise of Node.js for me has been this point: > In Node, everything runs in parallel except your code. Guaranteed single-threaded execution of my c
by jdlshore 13y ago
The real surprise of Node.js for me has been this point:
> In Node, everything runs in parallel except your code.
Guaranteed single-threaded execution of my code combined with a great concurrency story has been a revelation. I can do all kinds of stuff that would just be flat-out stupid in a multithreading language (like naïve performance monitoring and caching using global variables) and it's easy. I ask myself, "do I have a race condition?" then I look at the code, make sure there's no asynchronous callback between my global read and my global write, and say, "Nope! Ship it!"
Really, it's been a pleasure.
(Before anyone accuses me of ivory-tower-itis, this opinion is based on the production-grade, money-generating HTTP server, CMS, and site I wrote in Node.js: http://www.letscodejavascript.com http://www.letscodejavascript.com . And yes, the callback pyramid of doom sucks, I'm not saying it doesn't.)