8 ms·
This missed the point. The point of not that you can forget to check the null case. The point is that you can express that sometimes there's no null case.
by tibbe 7y ago
This missed the point. The point of not that you can forget to check the null case. The point is that you can express that sometimes there's no null case.
- jrockway 7y agoThe "no null" case in traditional languages is just "int" instead of "*int". All values inside an "int" are valid integers. Certainly it's problematic to use the same language primitive to mean "a pointer" and "this might be empty", but it's what people use them for in every language that has pointers (that I've used anyway).
- pornel 7y agoThat conflates pass by value/by reference distinction with being optional. This means you need magic values for "maybe int" with no help from the type system. And you can't express "there's definitely an int at that address".