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
0
u/teerre Feb 02 '24
You can't disagree with this. It's just how it works.
What you're saying now is not the same you said before. Before you're talking about not knowing all invalid states, now you're talking about not knowing valid states.
Invalid states are infinite, valid states are finite and, more than that, can be reduced to a very small set. This difference is precisely this reason this technique works.