Hacker News new | ask | show | jobs
by dahart 3412 days ago
C/C++ callbacks are fairly different in practice than what the article is talking about. You might like callbacks in JavaScript. You might really like promises -- no wild goose chase to track down the chain, because promises chain things explicitly and make async code look more synchronous.

What's most interesting about your point is that what the article suggests -- naming and de-nesting callbacks -- is in a way what you're warning against. By naming it and physically moving it, execution that was contained within a single block of code is now jumping around, and can move to other places where you have to go looking.

Even though it's considered an anti-pattern for good reasons, there are some advantages to nested callbacks.