8 ms·
When I first got into Kotlin I thought that null safety was a matter of getting rid of null, like some try to do in their Java code. Now I know that actually i
by geyforkotlin 4y ago
When I first got into Kotlin I thought that null safety was a matter of getting rid of null, like some try to do in their Java code.
Now I know that actually it gives me liberty to safely use null wherever I want and not have to worry about it blowing up in my face later.
The keys to this is that the language makes it obvious what can be null "Type?" and by giving me ergonomic tools to handle nulls such as ? and :? and compiler non-null inference. I wonder how this pattern of
make X visible and give ergonomic tools to handle X
could be applied to improve other aspects of programming.