News for hackers. Stuff that matters.
Re:Ask HN: Do You Use Enum for Yes, No, Unset? by disintegore on Friday June 17, 2022 @04:38PM (#31784008)
Yes/no/unspecified is a good match for something like `Option<bool>` or `bool?`. Their usage covers every case and nothing needs to be elucidated.

With that said, in a language that supports null and has no compile-time mechanism to detect potential null dereferencing (like modern C# for instance) I might use an enum.

There are no comments on this comment yet.