Kotlin expressiveness

One of the things that feels much different in Kotlin compared to Java is the type system. The void keyword for example is not present in Kotlin, so Unit type is used instead:

fun functionReturningNoValue(): Unit {
println(“Hello”)
}

I would say that this approach is more consistent than using a special keyword to denote functions that don’t return any value.

--

--

Impure developer and functional programming enthusiast

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store