Beyond Node.js Express: An Intro to Koa.js and a Preview of Zones
strongloop.comCompare:
- Pyramid of Doom (JS beginner)
- An array of functions in an async.waterfall (async module)
- A massive .then() chain (promises)
With: 'put the next thing on the next line' like every sync programming language you used before:
var fileContents = yield readFile('myfile', 'utf8');
console.log(fileContents)
This is the future.Looks more like the past to me, if you want to program synchronously, then why don't you just use Python?
If you properly decouple data flow and IO from your logic, you will not end up with callback hell.
If you shoehorn synchronous idioms into Node, then you're basically throwing away Node's advantage and you'll end up with something that performs worse.