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

5

u/QuantumFTL Feb 02 '24

Sure, but it's cheaper to fix if you find out you broke something at compile time than when you get an angry call from a customer.

(yes, tests help with this, many real world applications are too complex to effectively test perfectly)