String->(valid)Email is 'Parse', (invalid)Email->ValidEmail is 'Validate'.
> That way you never have to guess whether the email adress is unchecked
Now you just get to guess whether, for every class, there is actually a ValidClass that you were supposed to be using, instead of Class.
authenticate(User user);
^ This is a bug. We just let a malicious User object in because we invested extra time, effort and sloc into making both a User and a ValidUser class, disregarding the first "simple idea" from the article:>> 1. Use a data structure that makes illegal states unrepresentable
Or as I wrote:
> only make classes for valid objects