Code Room
Vibe codingMedium
Question
A legacy Node.js module uses error-first callbacks throughout. You ask an AI agent to migrate it to async/await. It converts each function and the code reads beautifully. Below is one converted function — what behavior regressed, and how would your verification have caught it?
// BEFOREfunction processBatch(items, cb) { let pending = items.length, failed = false; items.forEach((it) => save(it, (err) => { if (err && !failed) { failed = true; return cb(err); } if (--pending === 0 && !failed) cb(null); }));} // AFTER (agent)async function processBatch(items) { for (const it of items) { await save(it); }}What a strong answer looks like
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.
Learn the concepts
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.
Run or narrate your approach, then ask the coach.