Let’s start with the definition first
Defensive programming is a form of
defensive design intended to ensure
the continuing function of a piece of
software under unforeseen
programming practices are often
used where high availability, safety or
security is needed — Wikipedia
In 1980, NORAD reported that the US was under missile attack.
The problem was caused by a faulty circuit, a possibility the
reporting software hadn’t taken into account.
DEADLY RADIATION THERAPY
A bug in the code controlling the Therac-25 radiation therapy
machine was directly responsible for at least five patient
deaths in the 1980s when it administered excessive quantities
ROCKET LAUNCH ERRORS
The European Space Agency’s Ariane 5 Flight 501 was
destroyed 40 seconds after takeoff (June 4, 1996). The US$1
billion prototype rocket self-destructed due to a bug in the
on-board guidance software.
LOST IN SPACE
One of the subcontractors NASA used when building its Mars
climate orbiter had used English units instead of the intended
metric system, which caused the orbiter’s thrusters to work
incorrectly. Due to this bug, the orbiter crashed almost
immediately when it arrived at Mars in 1999. The cost of the
project was $327 million.
“You can’t sleep well if you are
not confident that your last
commit didn’t take down the