That is indeed an issue with a null that is not integrated into the type-system of your language. It is a mistake to let null be a valid member of every type and simply allow calls on it without any check like in Java, Objective-C, C, C++ or in plethora of other languages. I wrote about it in this story: https://medium.com/@elizarov/null-is-your-friend-not-a-mistake-b63ff1751dd5
Of course, if you program in those languages, then you should be worried about null. No question about that. That is one big reason to abandon all of those languages.

But if you program in a language with a type-safe treatment of null, then there is nothing to worry about. Type-safety has your code covered.

Written by

Project Lead for the Kotlin Programming Language @JetBrains

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