Work effectively with AI coding agents. Understand them as language models running in a tool loop with limited context, which is why they guess, game the visible signal and report confidently. Recognise the shortcut and correctness tells in their code across Python, TypeScript/JavaScript, Rust, Java and Go, and know the damage each one does later. Verify changes instead of trusting them, review diffs fast for quality and security, judge when work is truly finished, and choose, design and steer tasks so agents can finish them well.
Patching the symptom instead of the cause card 5 of 6

A catch that hides a broken writer

builds on: Agents optimise the signal they can see
A page crashes in `JSON.parse` with a `SyntaxError`. The agent wraps the parse in `try`/`catch` and returns `null`, so the cache simply misses. Tell: the catch wraps only the throwing call, and nothing says why stored data would be unparseable. Look at the writer: `localStorage.setItem(k, String(obj))` stores `"[object Object]"`. **Later cost:** nothing is ever cached, and every page load silently hits the API. The fix at the cause: write with `JSON.stringify(obj)`, and drop entries already stored in the broken form, for example by changing the cache key. Then the reader needs no catch for this.
Terms on this card
tell
An observable sign in a diff, transcript or summary that suggests a shortcut or an error.
later cost
The concrete damage a shortcut does after merge, such as a hidden bug, corrupted data or extra maintenance.
JSON.parse
JavaScript function that turns JSON text back into a value. It throws a `SyntaxError` if the text is not valid JSON.
SyntaxError
In JavaScript, the error `JSON.parse` throws when its input is not valid JSON text.
JSON.stringify
JavaScript function that turns a value into JSON text. `String(obj)` instead gives "[object Object]" for plain objects.
Learn this step by step on Bytewise
Lesson goal: Spot fixes applied where the error surfaces rather than where it originates: a null check at the crash site, a special case for the failing input, a catch around the throwing line. Explain why the error disappears but the cause keeps producing bad results. · the whole lesson