Hacker News new | ask | show | jobs
by blackysky 4666 days 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....
2 comments

Callbacks 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.

> 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 provides several excellent functions to make readable code instead of callback soup.