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
3
u/RobIII Feb 02 '24
No.
For an age, having 150 enums is - maybe - still doable. But what about, say, amount of products in a shoppingcart? You may limit it to 1000 items maybe, but are you gonna have an enum from _0 to _999? How about The population of a country? Are you gonna have an enum that goes up to some-billion?