News for hackers. Stuff that matters.
Re:Ask HN: Do You Use Enum for Yes, No, Unset? by dathinab on Friday June 17, 2022 @04:50PM (#31784193)
In some cases I encode the enum in the field name like `isThisOrElseThat BOOL` if you have clear opposites it often doesn't make sense to do so, but if it's non clear opposite either A or B choices or nullable and NULL isn't equal to false it can be helpful.

It also is annoying to use.

So if the DB supports a reasonable overhead enumeration that's a good choice, too (but that's not always the case, e.g. sqlite).

There are no comments on this comment yet.