Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
xigoi
· 1y ago · 0 comments
on/off also doesn’t make sense in many contexts, for example `isRegistered: on`.
Comments
[–]
qw
1y ago
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"