4 ms·
What are nulls extremely useful for in programming languages? At least one serious problem with nulls in many languages is that you can get one somewhere you a
by the_af 12y ago
What are nulls extremely useful for in programming languages?
At least one serious problem with nulls in many languages is that you can get one somewhere you are not expecting it, and you won't handle it correctly, resulting in an null pointer exception (if you're lucky) or a crash (if you're unlucky). That's why alternatives like Option types are so useful: you really cannot ignore them, so they won't catch you by surprise. And at the same time, you can often handle them in pretty painless ways.