Fail earlyEdit

"Fail early" is a design pattern that states that problems in a sequential chain of execution should be detected as early as possible, and the entire operation should be aborted as close to the site of failure as possible.

At first this may seem counter-intuitive as programmers generally don’t want their programs to fail. But by failing early problems can be discovered sooner, fixed, and the resulting product should be more robust. Also, failing early simplifies debugging by keeping the cause of a failure as close as possible to the site which causes the problem.

See also