News for hackers. Stuff that matters.
Re:Ask HN: Do You Use Enum for Yes, No, Unset? by throwaway81523 on Friday June 17, 2022 @06:11PM (#31785067)
In the code, it's considered something of a smell to use a bool at all. Look up "Boolean blindness". Basically instead of a bool field saying whether the person wants the deluxe upgrade, you'd have an enum whose values are Regular | Deluxe. How you would represent that in a db would depend on how your implementation works.

There are no comments on this comment yet.