Back story, read: https://medium.com/code-adventures/4ba9e7f3e52b
TJ says node fails because:
Can someone inform on the issues TJ mentions? For example, I've never seen problems with callbacks being double-executed. Under what conditions would it/they occur?
EDIT For those voting to close: If you don't know who TJ is, he's responsible for the majority of npm modules. So this isn't "idle" ranting by an uninformed user. His departure will greatly hurt nodejs and this question attempts to get answers as to specifics of the criticisms. I never see these issues. Do you?
Common Node. Uncaught exception or error event in JavaScript code. Excessive memory usage, which may result in an out-of-memory error. Unresponsive application, possibly looping or hanging. Poor performance.
js receives a CPU bound task: Whenever a heavy request comes to the event loop, Node. js would set all the CPU available to process it first, and then answer other requests queued. That results in slow processing and overall delay in the event loop, which is why Node. js is not recommended for heavy computation.
The short answer is “NO.” The long answer is, “NO, it's not dead, and it probably will never die.” Node. js is just as relevant to coding in 2021 and beyond, even if the hype around it has stabilized slightly.
1: can happen, when you wrap a stream in a function:
function doSomething (callback) {
var stream = createStream();
stream.resume();
stream.on('end', callback);
stream.on('error', callback);
}
so, what if end
fires, then error
fires?
2: the same thing, what if nothing fires (remove stream.resume
for example)? This obviously a bug in the function, but what you see is that everything just hangs.
4: you naively hook some asynchronous functions to emit error
events from emitter, then when the error occurs, a listener tries to destroy emitter, causes another error
event and ends up in an infinite loop.
5,6,7: each emitter without error
listener can potentially crash your app. You have two options: try to understand where it is safe to omit one or add them explicitly everywhere.
8: debatable. TJ is a proponent of coroutines, so it's just his opinion.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With