Base CS from zero
When a program fails: free-recall review
Retrieval beats re-reading. For each prompt, say or write a full answer from memory before you open the model answer — the effort of recall is what makes the distinction between condition and mechanism, loud and silent, reasoning and guessing actually stick.
Reconstruct the unit’s spine without looking back: error versus exception, how the stack unwinds, what a trace is and how to read it, why undefined behaviour is the dangerous case, and what makes debugging reasoning rather than guessing.
- 01What is the difference between an error and an exception?
- 02Walk through what the runtime does when an exception is raised and no handler is found.
- 03What is a stack trace, where in it is the throw site, and how do you read it?
- 04What is undefined behaviour, and why is it more dangerous than a defined error?
- 05Why does the determinism of the machine make debugging a matter of reasoning rather than guessing?
- 06Name the three moves for testing a debugging hypothesis, and explain why the throw site is not always the cause.
If you could reconstruct each answer from memory, you hold the unit’s spine: an error is the condition and an exception is the mechanism that stops flow and unwinds the stack to find a handler; the stack trace is that stack frozen at the throw, read top-down with the throw site on top; undefined behaviour is the dangerous silent failure with no error raised; and because the machine is deterministic, debugging is reasoning — form a hypothesis, narrow the range, read the trace, check state, and follow the chain past the throw site to the real cause before changing a line.