▲ | kenward 2 days ago | |
> fail-fast approach, immediately throwing when validation fails would this mask any errors that would occur later in the validation? | ||
▲ | nayajunimesh 2 days ago | parent [-] | |
With the fail-fast approach, yes - unless we introduce an option to collect all errors. In my own applications, I have found this to be a better default because the 'average' requests is valid and paying a constant overhead just to be thorough on rare invalid cases can be wasteful. My overall takeaway has mostly been to not optimize for the worst case by default. Keep fail-fast as baseline for boundaries and hot paths, and selectively enable “collect all” where it demonstrably saves human time. |