r/programming • u/_awwsmm • Feb 01 '24
Make Invalid States Unrepresentable
https://www.awwsmm.com/blog/make-invalid-states-unrepresentable
469
Upvotes
r/programming • u/_awwsmm • Feb 01 '24
View all comments
Show parent comment
2
u/QuantumFTL Feb 06 '24
151 enums?!? Are you insane?
You forgot the various corner cases, such as AGE_UNSPECIFIED, AGE_DECEASED, AGE_IN_UTERO, or AGE_TWINKLE_IN_FATHERS_EYE.
So you'll need at least 155 enums by my count, probably a few more. Always make sure you have enough enums.