Coroutines are not about multi-threading at all. The main benefit of coroutines is that you can write asynchronous code without callbacks. Avoiding concurrency is another reason we recommend launching coroutines in the main thread. This way your code behaves just at it used to behave with callbacks — no additional threads, no additional concurrency beyond you callback-based code.

All in all, writing responsive UI applications or scalable backend systems is not an easy task to start with, whether you use coroutines or not. In both cases differentiating between CPU-bound and IO-bound is important if you care about responsiveness and scalability. Coroutines, by themselves, do not add anything new to that picture. All these tools were in developers’ toolbox for many years. Coroutines just make this kind of code more pleasant to write from syntax and readability standpoint, making responsive and scalable apps a little bit closer to the reach for less experienced developers.

Written by

Project Lead for the Kotlin Programming Language @JetBrains

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