3 ms·
The stack of callbacks piling up is definitely not a great feature of node.js code. You can mitigate it by using declared functions instead of anonymous functio
by btipling 14y ago
The stack of callbacks piling up is definitely not a great feature of node.js code. You can mitigate it by using declared functions instead of anonymous functions but that also becomes burdensome when all your callback function does is call something else that also requires a callback.
This will be an interesting problem for node developers to solve. I like the Go approach of using channels. Twisted uses deferreds and inline yields depending on your preference. There are some libraries out there that people have written for node.js that also help.
- untog 14y agotame.js solves this to an extent by allowing await and defer calls in your JS code. Not native, of course.