Mr. Grummel Get the app
← All notes
LEARNING 5 MIN READ DRAFT — APRIL 2028

The programming skill that's really just deciding what a program should do when something goes wrong

Error handling anticipates what could go wrong and decides in advance how a program should respond, while debugging is the separate skill of tracing backward from an observed failure to its actual root cause.

Error handling is the deliberate practice of anticipating what could go wrong while a program runs, and deciding in advance how it should respond, crash safely, retry the operation, fall back to a sensible default, rather than letting an unexpected failure produce silent, unpredictable behaviour that only surfaces as confusion somewhere else later. Debugging is a separate, genuinely different skill: tracing backward from an already observed failure to find its actual underlying root cause, often several steps removed from wherever the failure first became visible.

Error handling means deciding in advance what counts as recoverable

Exception handling mechanisms, commonly built around try-catch blocks, let a programmer deliberately decide, at each specific point in a program where something could fail, a file not existing, a network request timing out, exactly how that failure should be handled. A core part of that decision is distinguishing between errors a program can meaningfully recover from on its own, and ones it genuinely can't, forcing it to stop and clearly report the failure instead of pretending to continue normally.

Debugging is the reactive skill of tracing an observed symptom back to its real cause

Debugging starts from an already observed symptom, wrong output, a crash, unexpected behaviour, and works backward to find the actual root cause, which is often located well away from where the failure was actually noticed. Tools like breakpoints, which pause a program's execution at a specific point for inspection, and logging, which records a program's internal state as it runs, both exist specifically to help narrow down exactly where a program's actual behaviour first diverges from its expected behaviour.

Error handling is the deliberate practice of anticipating what could go wrong in a program and deciding in advance how it should respond, crash safely, retry, fall back to a default, rather than letting an unexpected failure produce silent, unpredictable behaviour, and debugging is the separate, genuinely different skill of tracing backward from an observed failure to find its actual root cause.

What we're still unsure about

That error handling is a deliberate, anticipatory design decision and debugging is a separate, reactive investigative skill is well established, uncontroversial software engineering practice. What's more genuinely an ongoing, unresolved practical problem is that overly broad error handling, catching and silently ignoring a wide range of possible errors purely to keep a program running without crashing, can make later debugging dramatically harder, since it actively hides exactly the information a future debugging session would need, and there's no single, universally agreed rule for exactly how narrow or broad error handling should be in any given case, professional practice varies and reflects real, ongoing judgment calls rather than one settled convention.

This sits inside Error Handling & Debugging, one of eight topics in Programming, one of seven domains in Computer Science, one of seventeen subjects the app can quiz you on.

Draft — not published yet.
Try the pop quiz