3 ms·
I do think a set/enum is a better structure than a ternary field for T/F/null. Even if you defined the elements of the set to be { TRUE, FALSE, NULL }. Becaus
by mywittyname 7y ago
I do think a set/enum is a better structure than a ternary field for T/F/null. Even if you defined the elements of the set to be { TRUE, FALSE, NULL }. Because, I believe, most of us see a field containing a T/F and assume it's a binary, not ternary field. Even if someone notices that the field is null-able, they might assume it's a mistake.
Unless you've been burned by that before and remember to check those assumptions.
- beart 7y agoI prefer having a nullable version of other types so it has to be explicitly wrapped. bool vs nullable(bool)