Re:Everything is fine with JavaScript
by ralusek on Wednesday October 05, 2016 @11:36AM
(#12644742)
This image is absolutely ridiculous.
Problem: JavaScript won't run outside browser.
Solution: V8 (V8 was built for Chrome, btw, NodeJS is what took V8 outside of the browser)
Problem: JavaScript is single threaded by design. (This isn't a problem, you even said BY DESIGN)
Solution: Asynchronous programming. (This is a solution that literally allowed applications running on 20-30 machines to drop to 2 machines and still see over an order of magnitude performance improvements).
Problem: Callback hell. (Callback hell is NOT the way any reasonable Node developer programs. Promises are completely sensible to reason through).
Solution: Compile to better language (Promises are native)
I don't know how many times I have to post this, but this is what good Node code looks like.
There is no callback hell. The error handling is trivial. Doing parallel tasks is trivial. And that "single threaded" issue is not an issue. The moment parallel tasks1, 2, and 3 START, your application is already serving the next request. There is 100% CPU availability for every single thread, not a single moment is wasted blocking. And if you're running on a multi-core machine, you use node clustering to get 100% CPU usage of all of the cores.
People do just regurgitate the same nonsense over and over.
People do just regurgitate the same nonsense over and over.