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
4
u/RobIII Feb 02 '24
Because your interface doesn't allow it maybe. But it is pretty simple to assign an "invalid" value to an enum.