3 ms·
Yes, I too find callbacks an obstacle to readability, among other things. If one uses mongodb (popular on node.js), and one needs multiple queries to 'join' se
by zxv 10y ago
Yes, I too find callbacks an obstacle to readability, among other things.
If one uses mongodb (popular on node.js), and one needs multiple queries to 'join' several documents, the cascade of callbacks is an obstacle to readability, let alone debugging.
- mikeryan 10y agoIf you're writing a cascade of callbacks then just use promises. There's no reason to be needing to cascade callbacks pretty much all libraries now support promises and the rest can be promisified. I'm not calling it a Panacea but Promises are idiomatic Node Javascript now and there's almost no reason for mutliple levels of nested callbacks anymore.