4 ms·
It's not really having null that's bad. What's bad is making types nullable by default. More often than not, null is not a valid value for a variable (in my exp
by sdevlin 15y ago
It's not really having null that's bad. What's bad is making types nullable by default. More often than not, null is not a valid value for a variable (in my experience - YMMV). This is a common source of errors.
Some languages (I'm thinking of ML and Haskell) require you to opt into nullability with an option type (e.g. http://www.standardml.org/Basis/option.html http://www.standardml.org/Basis/option.html).
What's worse is that many mainstream languages do not allow you to opt out of nullability. I.e. most or all types are always nullable.
- deleted 15y ago[deleted]