3 ms·
Java's structured concurrency approach to async code eventually may result in much simpler libraries compared to Kotlin's approach, which introduces function co
by cempaka 3y ago
Java's structured concurrency approach to async code eventually may result in much simpler libraries compared to Kotlin's approach, which introduces function coloring with the "suspend" modifier.
- wiseowise 3y agohttps://elizarov.medium.com/how-do-you-color-your-functions-a6bb423d936d https://elizarov.medium.com/how-do-you-color-your-functions-... That’s a feature, not a bug. > We could eliminate suspend modifiers from pure-Kotlin code, but should we? I’m inclining to answer no. Having to mark asynchronous functions with suspend modifier is a small price to pay, but in return you get better insight into your code. You immediately see which functions are allowed to perform potentially long communications and which are supposed to complete quickly.