|
|
|
|
|
by sacado2
1064 days ago
|
|
In theory NULL (or any such sentinel value, such as the infamous NaN is floatin-point arithmetic) makes sense because there are partially defined functions. Division being the most famous example, but most basic operations on lists share that property too. The problem is the way it's handled in many programming languages, where it can blend so easily with legitimate value and blow the whole program off at execution time. It's a practical problem, not a theoretical one. And it's not the same as union types. The division of two numbers always returns a number, and nothing else, it's just that, for some values, it's not defined. |
|