# Coroutines - a better match for Kotlin than Reactive Streams?

DevFeed: [Coroutines - a better match for Kotlin than Reactive Streams?](<https://devfeed.tech/articles/coroutines-a-better-match-for-kotlin-than-reactive-streams-17704.md>)

Original publisher: [Read original article](<https://nexocode.com/blog/posts/reactive-streams-vs-coroutines/>)

Author: piotr-kubowicz

Published: 2020-05-12T00:00:00Z

Content type: article

Language: en

Sources: [Backend Development on nexocode](<https://devfeed.tech/sources/backend-development-on-nexocode.md>)

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [reactive](<https://devfeed.tech/topics/reactive.md>), [Reactive Streams](<https://devfeed.tech/topics/reactive-streams.md>)

Tags: [back-end](<https://devfeed.tech/tags/back-end.md>), [coroutines](<https://devfeed.tech/tags/coroutines.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [reactive](<https://devfeed.tech/tags/reactive.md>), [reactive-programming](<https://devfeed.tech/tags/reactive-programming.md>), [reactive-streams](<https://devfeed.tech/tags/reactive-streams.md>)

## AI overview

The excerpt shows how a simple Kotlin service can become harder to reason about when rewritten with Reactor. Combining user-profile and block-check streams with `zip` cancels the result if either stream is empty, which can cause a Spring REST endpoint to return HTTP 200 with an empty body. In the blocking version, Kotlin's nullable types and compiler warnings help surface missing-value handling; reactive streams require the programmer to handle the empty case explicitly. The excerpt says a fix exists but cuts off before showing it, and offers no evidence about how coroutines compare.

## Source excerpt

Using Reactive Programming is tempting because it promises to handle higher traffic on the same hardware. Yet this paradigm is also demanding: it increases code complexity and may make bugs harder to notice. Let's explore how you can use Kotlin and coroutines to reduce the cognitive load of maintaining reactive applications. Sample code Imagine you are developing a website that can be used by both logged-in and anonymous users, just like Wikipedia. At the same time, there are proper mechanisms in place to block misbehaving users. Our focus will be the back-end code returning a welcome message displayed on top of the main page: