HN
Hacker News
Top
New
Best
Ask
Show
Jobs
Comment by jeltz | Hacker News Reader
Parent
Full thread
jeltz
·
Then it should be on/off, not yes/no.
View on HN
xigoi
·
on/off also doesn’t make sense in many contexts, for example `isRegistered: on`.
qw
·
I often prefer enums over booleans for this. It seems more readable for most cases, and can be extended with new values.
This:
isRegistered: true
could be replaced with
accountStatus: "UNREGISTRED"
Reply on news.ycombinator.com