In everyday life
Like a water stain on a ceiling. Paint over it and the stain comes back. The fix is the leaking pipe upstairs, which may be two rooms away.
One case
A clinic’s appointment page crashes on appointments that have no patient. An agent adds a guardA check that stops code from running on bad data, such as “if there is no patient, stop”. It hides the problem unless that data is allowed.: if there is no patient, show nothing. The crash stops, but the phone booking screen still saves an appointment with no patient on it, and 40 appointments a week have no one to remind or bill.
Every case
A bug travels. Bad data is made in one place, passes quietly through several others, and breaks where something finally reads it. The crash marks the end of the trail, not the start. A fix at the crash hides the evidence and lets the same bad data break somewhere else. Ask “why?” at each step until the answer is a wrong decision in the code, not a result of an earlier one. A guard is right only when the state it handles is allowed: a logged-out visitor with no name is normal, an appointment with no patient is not.
The word
Engineers call this
Follow the bad data back to where it was made, and fix it there. Add a guard only when the state it handles is allowed.