"Defensive Programming is a well-regarded technique in software engineering."<p>No.<p>No, it's not.<p>Fail early, fail fast, crash loudly, and then react. That, plus deep validation testing, is how you build robust systems. Trying to soldier on when things are wrong just propagates bad data and bad behaviour into a larger surface area that needs cleanup.<p>Assert everything, even in production.
Capture all failures and action each one (turn a 500 crash into a validation failure 400, etc)<p>Monitor all logs for unexpected/new anomalies.<p>Be vigilant around testing. Failure cases are part of the spec, too!<p>That's how robust systems are really built!