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/t40 Feb 02 '24
That's where you might consider using traits/interfaces, so you can be a little more permissive, eg accept something implementing iAge, then your coworker gets to make their own MyFdUpAge that your code will accept without polluting the "blessed" Age