AndroidBites | Does lateinit actually solve your nullability problem?

AndroidBites | Does lateinit actually solve your nullability problem?

Β·

2 min read

Hi #androidDevs, This is Androidbites where I try to break down a small concept into an understandable code snippet and share my learning experience with it.

Today's topic is related to handling nullability using lateinit modifier, I absolutely agree null is the Billion dollar problem in a programming language, and for you, as a developer, it's your responsibility that your app doesn't fall in as a victim of it and not crash your app due to that, In kotlin there are many languages functionalists build in that enable you to aware of null happening code and ask you to cater them properly.

Lateinit is one of those tools, the solution of a problem is not to create that problem right? Similarly instead of having a nullable type just replace it with non-null type? right 🧐? an obvious solution,

let's dig deeper with the snippet below, πŸ‘ on the code πŸ’».

lateinit vs nullable (1) (1).png

if you like to know more on the same topic read the complete article on

See you on the other side 😈...

Happy hackingπŸ’»

Stalk Me πŸ‘€ :
LinkedIn | Medium | Twitter | StackOverflow | CodeWars | WorkX | Github | Instagram | Youtube