spion.github.io
Why I am switching to promises
http://spion.github.io/posts/why-i-am-switching-to-promises.html
Code, music, math. Code, music, math. Why I am switching to promises. Sun Oct 06 2013. Im switching my node code from callbacks to promises. The reasons arent merely aesthetical, theyre rather practical:. Were all human. We make mistakes, and then JavaScript. S an error. How do callbacks punish that mistake? They crash your process! But spion, why dont you use domains? Yes, I could do that. I could crash my process gracefully. And guess what a user that hits an error does? For more info see #5114. The ca...
bluebirdjs.com
Why Promises? | bluebird
http://bluebirdjs.com/docs/why-promises.html
New in 3.0. Coming from Other Languages. Coming from Other Libraries. Updated 31 Aug 2016. Promises are a concurrency primitive with a proven track record and language integration in most modern programming languages. They have been extensively studied since the 80s and will make your life much easier. You should use promises to turn this:. Unable to read file. Invalid json in file. Invalid json in file. Unable to read file. If youre thinking, Theres no. That returns a promise! Invalid json in file.