![]() Valid usages of null in Kotlin 1) When Representing “No Value” var user: User? = null There are perfectly appropriate safe uses of null in Kotlin. However, just because it’s easy to identify null in Kotlin doesn’t mean we should use it everywhere. ![]() Yes, it’s to be avoided in most code, but in Kotlin, null is part of the type system and the compiler will tell you when you haven’t handled it appropriately. I was recently reviewing code with a developer that is learning Kotlin and they were adamant that:
0 Comments
Leave a Reply. |