Parse, Don’t Validate
This is describing what I've known as "Typed Hungarian notation", and have seen a few times before, though I can't seem to find now.<p>The original intent of Hungarian notation was to encode metadata into the variable name - for example, "validData = validate(rawData); showValidData(validData)".  The idea was that the prefixes would make it just look wrong to the programmer if someone accidentally used mismatched names, such as "showValidData(rawData)", indicating a likely bug.<p>This notation mutated into the far more simplistic and arguably less useful "prefix with the datatype", such as iFoo indicating Foo is an integer.  This mutation became known as Systems Hungarian, while the original became Apps Hungarian.<p>The suggestion in this post is taking Apps Hungarian, and instead of relying on variable names, encoding it into the type system itself.<p>The first time I recall seeing something like this suggested was actually in Java, with examples in that blog post involving class attributes:<p><pre><code>  public String Name;
  public String Address;
</code></pre>
And creating classes to represent these values, preventing them from being used the wrong way:<p><pre><code>  public NameType Name;
  public AddressType Address;
</code></pre>
...which is why I remember this as "Typed Hungarian" - making the language's type system handle the work that a person would normally have to think about in Apps Hungarian.