# The Power of Types for Errors

DevFeed: [The Power of Types for Errors](<https://devfeed.tech/articles/the-power-of-types-for-errors-2113.md>)

Original publisher: [Read original article](<https://developers.soundcloud.com/blog//power-of-types-for-errors>)

Published: 2020-01-20T00:00:00Z

Content type: article

Language: en

Sources: [SoundCloud Backstage Blog](<https://devfeed.tech/sources/soundcloud-backstage-blog.md>)

Topics: [Code](<https://devfeed.tech/topics/code.md>), [Android](<https://devfeed.tech/topics/android.md>), [App](<https://devfeed.tech/topics/app.md>), [User experience (UX)](<https://devfeed.tech/topics/ux.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [app](<https://devfeed.tech/tags/app.md>), [bugs](<https://devfeed.tech/tags/bugs.md>), [code](<https://devfeed.tech/tags/code.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [engineering](<https://devfeed.tech/tags/engineering.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlinconf](<https://devfeed.tech/tags/kotlinconf.md>), [types](<https://devfeed.tech/tags/types.md>), [ux](<https://devfeed.tech/tags/ux.md>)

## AI overview

The article explains how using custom types, sealed classes, and type hierarchies can model application error states more precisely than independent parameters or enums. This approach makes relationships explicit, improves readability, prevents invalid arguments, and helps the compiler reduce bugs in an Android app's signup tracking flow.

## Source excerpt

At KotlinConf 2019, I talked about the power of types. In essence, I discussed limiting the number of primitives we use in our code in favor...