3 ms·
Callbacks are simpler, easier to understand and explain. 'callback hell' is usually the result of 'poor code structure' that get's fixed with separated named fu
by hugozap 10y ago
Callbacks are simpler, easier to understand and explain. 'callback hell' is usually the result of 'poor code structure' that get's fixed with separated named functions.
- davexunit 10y agoWriting in continuation passing style manually isn't great. It really does become confusing and hard to debug very quickly. That said, promises also aren't the solution, because you still have to contort your code to be compatible with promises. Further more, async/await is yet another non-solution because now you have to differentiate between synchronous and asynchronous functions. Still, both of these are improvements upon simple callbacks. What JavaScript is lacking is a real implementation of "communicating sequential processes" a la Go, ConcurrentML, etc.