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

Whenever some calls something else opinionated, you have to be aware they probably mean it just doesn't square with their opinion.


I think there's a similar but stronger form of opinionation where a choice prevents you from ever implementing something.

In this case, not being able to synchronously resolve a promise prevents you from using them in certain ways. You can attach flatMap to the prototype or build a better way of doing cancellations, but you'll need to make additions to the language itself to turn a promise synchronous, which is what await/async were all about.

Having said all that, the bar for promises isn't set by RxJS, it's set by callback(err).

EDIT: also, promises were very much discovered. They're an opinionated solution to the very specific problems of callbacks. They're chainable because of callback hell. Errors propagate because that's a problem with callbacks. Their execution is always delayed because callbacks made it hard to reason about execution order. They don't handle cancellation because callbacks don't handle cancellation.




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

Search: