When you have to deal with single asynchronous events, Promises with async/await are an excellent tool.

When you have to deal with streams of events, such in the case of the article, then Observables provide you with a wider set of tools. Just to give you an example, you can control the level of concurrency simply via a parameter of mergeMap operator. If you have to use Promises or just pure callbacks, things can get more complex.

Observables are tough to debug? Yes. Because of the way the library has been designed? I do not think so. I think they are tough because asynchronicity is tough.

Observables, and in general reactive and functional programming, require a certain change in the way we imagine first and then design and build SW. There is a paradigm shift from what we are normally used, sequential imperative synchronous programming. At the end though, I suspect they give developers better tools to build better solutions, as long as they are not abused for the sake of academic purity.

A man with passion for code and for some strange things that sometimes happen in IT organizations. Views and thoughts here are my own.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store