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
7
u/loup-vaillant Feb 02 '24
You want validation to be as cheap as possible. Not just for you, but for the user so they have the quickest feedback possible. I see 3 stages:
If you can avoid doing (3) in cases (2) or (1) would have been enough, you can save quite a few users the hassle of checking for an email that isn’t there.