Thanks for the article. We definitely need to talk more about the perils of unstructured concurrency. Let me add a note about Kotlin’s “grey area” here. Even though Kotlin does not have await keyword, all the points in code where context can switch (suspension points) are clearly marked in Kotlin by IDE. The reason to omit await keyword was both syntactical (we can naturally support more language constructs, e.g. we don’t have to a special await for loop, etc) and philosophical. In Kotlin you cannot omit await and get a task started concurrently. All concurrency in Kotlin is explicit and requires you to write more code, not less. It is covered in more details in “Introduction to Coroutines” talk for KotlinConf 2017:

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