News for hackers. Stuff that matters.
Re:Parse, Don't Validate (2019) by imtringued on Tuesday February 10, 2026 @12:50PM (#46963843)
I agree and for several reasons.

If you have onerous validation on the constructor, you will run into extremely obvious problems during testing. You just want a jungle, but you also need the ape and the banana.

Re:Parse, Don't Validate (2019) by mh2266 on Tuesday February 10, 2026 @01:19PM (#46964340)
What big external dependencies do you need for a parser?

`String -> Result<Email, Error>` shouldn't need any other parameters?

But you should ideally still have some simple field-wise constructor (whatever that means, it's language-dependent) anyways, the function from String would delegate to that after either extracting all of the necessary components or returning/throwing an error.