Hacker News new | comments | show | ask | jobs | submit login

>They're just continuations, seriously, what's everyone's problem?

That they're badly made continuations, without support from the language.

>If you feel like your code is nesting too deep, you define the function elsewhere and just reference it by name. Then you don't get access to the current scope.

At the cost of moving stuff out of where it's invoked, so making code harder to read.

The problem with callback hell is that is pushes the programmer to write FOR the machine, in the way the machine likes it. Those things should be an implementation detail, and in good languages, are.

My favourite example of this is loops. Its very annoying to put an async call inside the loop since you need to rewrite the loop as a recursive function.


Once I started using the async library, all of these problems everyone is illustrating basically disappeared.

Something lie this? http://taskjs.org/

Unfortunately task.js requires javascript generators which are only implemented in Firefox right now.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact