News for hackers. Stuff that matters.
Re:Parsix: Parse Don't Validate by finnh on Saturday May 15, 2021 @12:42PM (#27166743)
It encourages people to use strongly typed classes rather than primitives, even if the type simply wraps a primitive.

As a result you can't pass a invalid (say) accountID deep into your code, bc validity is guaranteed to be checked early when you "parse" an input string into the "AccountId" type.

So: internal interfaces defined using non-primitive types, so internal methods don't need to keep validating their input. Conversion to said types happens early and predictably, catching bad values before they (eg) hit the database.

There are no comments on this comment yet.