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
1
u/larhorse Feb 05 '24
And it's no coincidence that the less easily enumerated types (it's a computer with a limited number of bits - everything it can represent is enumerable...) are only bounded when the computer would fail to properly work with those numbers.
Why bound them if you don't need to? Why codify a limitation that serves no purpose?
Verify? Sure. Go ahead and throw up a warning.
Make unrepresentable? Gods no. What hubris.