Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Promises are certainly better than promise-free 2005 style callback code, but they do require that you reimplement language features like try/catch. Yield allows you to do asynchronous try/catch, which doesn't depend on some library getting the implementation right (libraries often lump rejections and thrown exceptions together) and looks more sensible anyway.

There are other advantages to yield as well. Entire design patterns like CSP aren't possible without it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: