←back to thread

Parse, Don't Validate (2019)

(lexi-lambda.github.io)
389 points melse | 1 comments | | HN request time: 0.199s | source
1. AlexSW ◴[] No.27642443[source]
I couldn't agree with this post more.

I found myself replacing the configuration parsing code in a C++ project that was littered with exactly the validation issues described, and converted it to that which the author advocates. The result was a vastly more readable and maintainable codebase, and it was faster and less buggy to boot.

Another nice advantage is that the types are providing free/self- documentation, too.