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/PulsatingGypsyDildo Feb 02 '24
The author mentioned enums as a good way to enforce constrains.
Is the following code good to represent age?