Nullpointerexception message

My opinion is somewhere in between. Descriptive error messages are always good to have, there is no reason to not implement them. On the other hand, this feature is of a very low importance to me. I don’t remember the last time I got NPE in Kotlin and even if that happens, it is usually very clear without a good message as there are very few places in the code where NPE may happen.

Also, !! is for pretty rare cases when we are sure a variable is not null, because there is some nullability logic that can’t be easily represented statically. We should avoid it if possible.

1 Like