3 ms·
In languages without "everything can be null", the null-object pattern is what is always done. The problem with "everything can be null" is the type system is
by paulddraper 8y ago
In languages without "everything can be null", the null-object pattern is what is always done.
The problem with "everything can be null" is the type system is prevented from finding very common "you can't do this thing" errors.
Without it, everyone uses null objects (or Maybe, a generic for of this) and there are no segmentation faults/dereferencing errors. (Yes there can be other sorts of errors, but the problem has been made far better.)
- goto11 8y agoThe "Null object pattern" is a particular pattern where missing values are represented with an object with "neutral" behavior. This is not the same as an actual null or an option type.