Roman Elizarov
1 min readFeb 15, 2019

--

It is a matter of simple pragmatism. A case like Just a | Nothing is extremely common in the actual application code. So common, in fact, that it totally warrants a separate syntactic support by the programming language and Kotlin’s nullable types deliver it. It makes most typical day-to-day application code easier to read, easier to write, with less boilerplate and more focus on the substance.

Definitely, there would be cases where you need more details and more alternatives. Kotlin has sealed types for that. They are more verbose and that is so by design. They occur much less often in practice.

--

--

Roman Elizarov
Roman Elizarov

Written by Roman Elizarov

Project Lead for the Kotlin Programming Language @JetBrains

No responses yet