Promises just wrap callbacks. So you had callback hell, now you have wrapped callback hell. Nice change, huh. Only thing promises are good for is handling errors, but I don't know if it's worth it.
 
If you want to turn async code to sync-like code, I would suggest to use generators and `co` module instead.
 
 
15.09.2014, 20:51, "// ravi" <ravi-li...@g8o.net>:
On Sep 15, 2014, at 2:57 AM, Ingwie Phoenix <ingwie2...@googlemail.com> wrote:
Hai, everyone.

So I just figured out that Connect's static file servers dont work well with symlinks...so I had tow rite myself a little workaround, a fallback router, per-se. But whilst I did so, I had a nice meeting with the callback hell. Here's my code:

<…>

Okay...thats lots. And how does one get around this and into a bit of nicer code? It almost looks like a little pyramid there…

 
 
Have you taken a look at Promises? Bluebird is widely considered the fastest implementation. I found Q easier to understand and a bit better documented.
 
 
—ravi
 
 
 

 

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/F7E5827B-8287-4C6B-9975-DD0C8CA1059E%40g8o.net.
For more options, visit https://groups.google.com/d/optout.

--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/461211410800462%40web30g.yandex.ru.
For more options, visit https://groups.google.com/d/optout.

Reply via email to