4 ms·
In this thread: people who don't use Node.js making wild presumptions about how it works. Callback hell? Been a few years since that's been a problem.
by robinduckett 9y ago
In this thread: people who don't use Node.js making wild presumptions about how it works. Callback hell? Been a few years since that's been a problem.
- vorpalhex 9y agoIt depends :tm:. There are still a lot of codebases that are callback heavy. For one, callbacks are faster than promises in a lot of node versions by a very large margin. In other code bases, legacy rules still apply. Promises don't work well for some more complicated logical flows (though they're pretty damn perfect for the common ones) and async is still pretty new. Just because it's not a problem you deal with doesn't mean that it doesn't still affect plenty of devs.
- robinduckett 9y agoYou can mitigate callback hell using classes, which are far quicker than promises and easier for humans to parse than callback chains.
- vorpalhex 9y agoGenuinely curious, how? Do you have some example code to post?