News for hackers. Stuff that matters.
Re:Sane Async Patterns in JavaScript by quarterto on Thursday April 04, 2013 @12:34PM (#5493555)

  Next time you're about to define a function with a callback argument, don't.
No, do. It's the prevailing style in Node.js and elsewhere, and so there exist tools to transform them (syntactically or otherwise) into more palpable styles:

https://github.com/0ctave/node-sync https://github.com/BYVoid/continuation https://github.com/JeffreyZhao/wind https://github.com/Sage/streamlinejs

Re:Sane Async Patterns in JavaScript by joshguthrie on Thursday April 04, 2013 @01:49PM (#5494031)
I already knew about node-sync, but continuation really brings something new. I'll check the source to understand what it does under the hood.
Re:Sane Async Patterns in JavaScript by j_s on Thursday April 04, 2013 @03:24PM (#5494700)
Also, the comparison on the project's README is informative (and lists additional options):

https://github.com/BYVoid/continuation#relevant-projects

Re:Sane Async Patterns in JavaScript by craigyk on Thursday April 04, 2013 @04:05PM (#5494931)
I agree, I often will write promise wrappers for other people's stuff, but for the external surface of my module I have callbacks.

Also, callbacks ARE sometimes nicer than promises, etc... especially if you have CoffeeScript function syntax.