As you can see this has always been and is still a controversial issue.

The gospel is, callbacks are fine and you are wrong. Somethings are still
going to be fixed with domains etc.

I think the misunderstandings is due to the fact on the level of
complication of stuff being handled. Some people just push some streams
through and need high effectiveness others do stuff that is already
complicated enough by itself.

My first larger project I did with node was scientific analysis of data
collected in a mongodb database -- controlled by a user via a web
interface. Thus I personally never bought into that gospel. Things were
complicated enough without having to wrap my head around callback issues,
and being able to request several items at the same time from database
could speed up stuff, it didn't really matter that much. I changed the
project on the fly to Bruno's streamline which rescued it (otherwise I'd
had to redo it with something completely different, it wasn't manageable
anymore)

I also know of friends whom I tried to convince how awesome node is of
which I know that turned it down due to callbacks.

Node has recently lost one of its main contributors due to callback issues.
And no, promises and flow control libraries didn't cut it. His main point I
understood was, bugs caused by misbehaving libraries that fail to call a
callback or even worse, call it twice, are extremely hard to debug.

Right now I'm using suspend,
https://github.com/jmar777/suspend
which takes advantage of harmony generators.

I like it, since it is the most reliable on getting backtraces in case of
an error. Bruno's stuff should generate backtraces too, but I had issues in
case of rethrowing catched errors. On the other hand, suspend and
generators are little more try on when to put a * and when not, and result
into hangups if you do it wrongly, while Brunos preprocessor proofed to be
very reliable in pointing out a variety of coding errors.

My advice is, if you do a library that is to be used by others, you ought
to use simple callbacks, as this is still the lingua franca in node world.

What you do inside is up to you and if you do an application or anything
that is not a library to be used by others, there is no definitive answer,
do not listen to the gospel, try things out, look what works best for you.

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CABg07fvC_5vKW3vNdJ86FW%2BBu4AXX%3DxzJ%2B%2BmaQOVO%2BRa2NAW5w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to