Settings

Theme

Beyond Node.js Express: An Intro to Koa.js and a Preview of Zones

strongloop.com

15 points by bnoordhuis 12 years ago · 2 comments

Reader

nailer 12 years ago

Compare:

- 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.
  • voidr 12 years ago

    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.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection