# Using Kotlin Coroutines to Reduce Reactive Code Complexity

DevFeed: [Using Kotlin Coroutines to Reduce Reactive Code Complexity](<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: tutorial

Language: en

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

Topics: [Coroutines](<https://devfeed.tech/topics/coroutines.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [reactive](<https://devfeed.tech/topics/reactive.md>)

Tags: [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 article compares Kotlin coroutines with reactive programming for backend code. It explains that reactive streams can add complexity and hide empty-result cases, using a Reactor zip example where an empty input can cancel the resulting stream.

## 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: