Data validation: fail fast, fail early vs. complete validation

Posted by Vivin Paliath on Stack Overflow See other posts from Stack Overflow or by Vivin Paliath
Published on 2010-04-02T23:54:37Z Indexed on 2010/04/03 0:03 UTC
Read the original article Hit count: 470

Regarding data validation, I've heard that the options are to "fail fast, fail early" or "complete validation". The first approach fails on the very first validation error, whereas the second one builds up a list of failures and presents it.

I'm wondering about this in the context of both server-side and client-side data validation. Which method is appropriate in what context, and why?

My personal preference for data-validation on the client-side is the second method which informs the user of all failing constraints. I'm not informed enough to have an opinion about the server-side, although I would imagine it depends on the business logic involved.

© Stack Overflow or respective owner

Related posts about data-validation

Related posts about fail-fast-fail-early