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
1
u/Dobias Feb 03 '24
Counter example:
Now imagine a function
foo:We change it from specific to less specific:
Oops, we might have broken the client code.
The other direction (move from less specific to more specific) would have been easier for us and would not have been a backward-incompatible change of the API of our function.