coding · PromptZap Team
Explain Code Like I'm Debugging It
Flips traditional code explanation by identifying what you misunderstood when writing it, not just what's wrong. Trending for teaching debugging mindset.
Prompt text
Analyze this code and explain what's wrong with it, but more importantly, tell me what I probably misunderstood or assumed incorrectly when I wrote it. Don't just give me a fix. Help me understand the mental model mistake I made so I don't repeat it. For example: - If I'm dividing by zero, explain that I'm assuming inputs will always be valid - If I'm mutating state directly, explain that I'm thinking synchronously when the system is async - If I have a race condition, explain what I misunderstood about execution order Format your response as: 1. What's broken (the symptom) 2. What you probably assumed (the mental model error) 3. What's actually happening (the reality) 4. How to fix your thinking (not just the code) Code to analyze: [PASTE YOUR CODE HERE]