Re:Kotlin becomes second most popular language on the JVM
by vips7L on Thursday February 06, 2020 @01:43PM
(#22258891)
Optional is just signaling to the user that they should check.
You could also do this in Kotlin and boom there goes the safety:
fn nonNull(): String {
val s: String? = null
return !!s
}
i kinda get how this is safer, but clients can just call optionalRef.get() without checking, and boom there goes the safety. compiler warnings be damned.