Hacker News new | ask | show | jobs
by mywittyname 2262 days 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.

1 comments

I prefer having a nullable version of other types so it has to be explicitly wrapped. bool vs nullable(bool)