Check AI-Written Code Once Through
The whole chapter said “you don’t have to write code, but you do need to check it”—today you actually check something real. Three tiers by how much time you’ll put in: the lightest one takes 30 minutes; in a week you can turn checking into a work habit. Every tier ships with a ready-to-use prompt.
Task 1 · Make AI account for itself
First step of checking: don’t read the code—audit the confession
Grab a piece of code AI already wrote for you (don’t have one? Ask AI to write a small “contact-list dedupe” tool: take a pile of names + phone numbers, drop the duplicates). Then throw the prompt below at it and make it confess which way of organizing it used.
Task 2 · Demand a different organizer
Same feature, two implementations—you’re the judge of trade-offs
Take Task 1’s code and have AI rewrite the same feature with a different data structure, then list a trade-off table for both versions. The key is the last step: don’t let AI deliver the verdict—you decide which version fits your scenario.
Task 3 · Pick a structure for your own project
Choose yourself first, then compare answers with AI
Pick a real need on your plate (work project or personal tool—either’s fine). Don’t ask AI yet—use the “how do I look up / how do I get in and out” decision mantra from ds-summary and pick the data structure yourself; then let AI independently produce a selection plan and see whether you two agree. Run the self-check list below first so the scenario is clear before you start.
📋 Pre-selection self-check (tick all before asking AI)
While doing the tasks, if you see these three signals in AI’s answers, chase one more round of questions.
Nested loops hunting for things
Two layers of for comparing one by one—that’s ds-1’s “big drawer inside a big drawer.” Ask once: “Would a Set / hash table be faster?”
Can’t name what it rejected
When you ask for alternatives it only praises the current pick and can’t name a rejected option—that means it never selected; it just defaulted.
Demo only on tiny data
A demo flying on 10 rows means nothing. Always ask: “What if data grows 1000×?”—the most valuable sentence in this chapter.
✅ What this lesson wants to share
- Checking starts with auditing the confession: make AI account for structure, reasons, and alternatives—exposes problems faster than reading the code itself
- You deliver the verdict: AI lays out facts and comparison tables; “which version fits my scenario” must be your call
- Five questions before selecting: scale, read/write mix, order, dedupe, cache—clear these before asking AI and plan quality jumps a tier
- Pick first, then compare answers: checking eyesight grows in the gap where you and AI disagree