Rubber Duck Debugging
The classic rubber duck debugging technique β explain your code to a rubber duck until you spot the bug yourself β works even better with AI. The AI actually responds, asks questions, and spots things youβve been staring past for an hour.
The Recipe
I'm trying to [what the code/system is supposed to do].
Here's the problem: [describe what's actually happening vs. what you expect]
Here's the relevant code / setup:
[paste your code or describe your system]
Walk me through what this code is actually doing, step by step. Don't jump straight to a fix β first help me understand where the logic breaks down. Then suggest the fix.
Example β A loop thatβs not working
I'm building a script that should send a reminder email to everyone on a list who hasn't responded in 3 days.
The problem: It's sending reminders to everyone, including people who have responded. I've checked the condition twice and it looks right to me.
Here's the relevant code:
[paste code]
Walk me through what this loop is actually doing, step by step. Don't jump straight to a fix β first help me understand where the logic breaks down.
Works for non-coders too. Stuck on a spreadsheet formula? A logic puzzle? A process that isnβt working? Use the same approach β describe what you expect vs. whatβs happening, then ask AI to walk through it step by step.
π Leftover Remixes
πΆοΈ Spicy: After the fix: βNow assume the fix introduces a new bug. Whatβs the most likely unintended consequence of the change you just suggested?β
π§ Mild: Just paste the code and ask: βExplain what this code does, line by line, in plain English.β
π° Budget: βWithout fixing it, just tell me: what are the 3 most likely causes of this kind of bug?β