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.
Overbuilt code: speculative abstraction and defensive clutter
card 6 of 6
Size the code to the task
builds on: Why agents fill gaps with plausible guesses
One user means no interface, no factory and no option nobody sets. A check earns its place only if some real input can reach it. Ask for the plain version, and add an abstraction when a second real case shows up.
Terms on this card
- interface
- A type that lists method signatures without code; classes that implement it supply the code, so callers can use any of them interchangeably.
- factory
- A function or class whose job is to create objects, usually picking which concrete type to build from an argument.
Lesson goal: Spot code bigger than the task needs: interfaces, factories or config options with one user, generic frameworks for a single case, and redundant null checks and try/catch on paths that cannot fail. Explain the later cost: more code to maintain, contracts blurred by defensive checks, and real bugs hidden in noise. Name the simpler version. ·
the whole lesson