8 ms·
I like JavaScript and node.js but I simply can't wrap my head around callbacks. Some people simply love to nest callbacks... Anytime I see that it drives me cra
by blackysky 13y ago
I like JavaScript and node.js but I simply can't wrap my head around callbacks. Some people simply love to nest callbacks... Anytime I see that it drives me crazy....
- SwellJoe 13y agoCallbacks are possibly not the best way to solve concurrency issues. Node.js does it that way, but there's no inherent reason JavaScript should only solve concurrency problems with callbacks. It would be possible to implement a wide variety of concurrency models in JavaScript, and I'm sure people have and will. Node.js happens to be the early winner in that space. We are still pretty early in the JavaScript story on the server side.
- Deestan 13y ago> Some people simply love to nest callbacks... Anytime I see that it drives me crazy.... This is the correct reaction to heavily nested callbacks. https://github.com/caolan/async https://github.com/caolan/async provides several excellent functions to make readable code instead of callback soup.