🤖▶️ Check out the Design Patterns Overview course by Steve @ardalis Smith!Check it out »Hide


Murphy's Law

Murphy's Law

Murphy's Law states: "Anything that can go wrong will go wrong."

In Software

Murphy's Law is often applied to software systems and hardware devices. When designing and building systems, it's important to think about all the possible ways a system might fail - because at some point those things will probably happen. Defensive programming is the practice of writing code that anticipates problems and handles them before they can cause bigger problems. One principle that is often applied in software is to fail fast when problems arise. The sooner bad input is detected, the less damage it can cause, the fewer system resources are consumed dealing with it, and the faster the user can correct the issue.

See Also

Defensive Programming

Fail Fast


Murphy's Law(Wikipedia)

Edit this page on GitHub

On this page

Sponsored by NimblePros