3 ms·
In my last project (Kotlin; web app) I've decided against async (coroutines). I just want to keep it simple. Async "infects" you code: for it to bring benefit
by flossly 21d ago
In my last project (Kotlin; web app) I've decided against async (coroutines).
I just want to keep it simple.
Async "infects" you code: for it to bring benefits your whole codebase needs to be doing it (ingesting requests, db calls, web API calls).
Due to this we see "split" stacks in programming languages: one lib stack for synchronous, and one for async.
I did not think the benefits of better performance under load is worth the mental overhead of doing async everywhere. So i went with blocking calls and virtual threads. No regrets.
- tcfhgj 21d ago> for it to bring benefits your whole codebase needs to be doing it (ingesting requests, db calls, web API calls). not really - the core of apps (usually no outside dependencies), and additions which solely rely onthe core, usually can be implemented without async entirely; async only comes into play once you add dependencies to file system, network and ui, but you don't need to make the core async for that. You might not call some functions in async code at all, because the function is used only for heavy computation which is best handled by dedicated threads to avoid stalling your io handling.
- vips7L 20d agoWhether you use async or blocking calls you’ll still want to keep IO at your edges otherwise you end up with tightly coupled spaghetti.