r/eli5_programming • • Oct 06 '22

Question What is null safety?

It would be really helpful to explain it with an example that a child could understand. Thanks in advance.

5 Upvotes

5 comments sorted by

View all comments

Show parent comment

2

u/ralphtheowl Oct 07 '22

To add to this, the most important reason why null safety is important is that even the most experienced programmers will forget to check for a variable/result being not null. This means that the program could throw null pointer (or its equivalent) exceptions at unexpected places, typically crashing the process.