3 ms·
I'm all for the idea that relational fields should be NOT NULL What if the data is actually missing? How else do you record that information?
by nerdponx 9y ago
I'm all for the idea that relational fields should be NOT NULL
What if the data is actually missing? How else do you record that information?
- zupa-hu 9y agoYou use the default empty value, and have an extra field for missingness. Than you have real type safety.
- TheDong 9y agoReal type safety is sum types. If I need to express something that is present or missing, I should use a Maybe monad. Having an extra field for "missingness" is less safe because the type system won't enforce that it is either missing or set, you could have it set to a value but marked as missing which is still ambiguous.
- sorkin2 9y agoThat's a "cure" worse than the disease.
- taeric 9y agoIf missing data is a valid value, pick a valid way to encode it. Null might work, but realize you could have to reason for the value. Actually missing, or just not collected it recorded. I concede there may be no difference in those meanings.