News for hackers. Stuff that matters.
Re:Fixing the callback spaghetti in node.js by bluesnowmonkey on Thursday September 29, 2011 @03:17AM (#3051482)
That "callback spaghetti" is called continuation-passing style.

"Programs can be automatically transformed from direct style to CPS." [1]

Do the math.

[1] http://en.wikipedia.org/wiki/Continuation-passing_style

Re:Fixing the callback spaghetti in node.js by thomasz on Thursday September 29, 2011 @03:32AM (#3051511)
I don't fully understand why this makes callback hell better just because it is known under a nicer name. CPS has it's use cases, but application code is not one of them.
Re:Fixing the callback spaghetti in node.js by seabee on Thursday September 29, 2011 @03:55AM (#3051554)
Specifically, CPS was intended as a mechanical program transformation to remove the stack, not a style for programmers to actually write their programs in.
Re:Fixing the callback spaghetti in node.js by m0wfo on Thursday September 29, 2011 @04:17AM (#3051600)
And in a lot of other languages writing in CPS incurs a performance penalty (lucky for me it seems to be < 1 order of magnitude in clojure); I assume this is the case in node.js too?