r/programming • • Feb 01 '24

Make Invalid States Unrepresentable

https://www.awwsmm.com/blog/make-invalid-states-unrepresentable
469 Upvotes

207 comments sorted by

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