3 ms·
That "callback spaghetti" is called continuation-passing style. "Programs can be automatically transformed from direct style to CPS." [1] Do the math. [1] ht
by bluesnowmonkey 15y ago
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 http://en.wikipedia.org/wiki/Continuation-passing_style
- thomasz 15y agoI 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.
- seabee 15y agoSpecifically, CPS was intended as a mechanical program transformation to remove the stack, not a style for programmers to actually write their programs in.
- m0wfo 15y agoAnd 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?