When debugging code:
- •Understand the symptom: What error message or unexpected behavior is occurring?
- •Read the relevant code: Trace the execution path from entry point to the failure
- •Identify the root cause: Pinpoint the exact line(s) causing the problem
- •Draw a diagram: Use ASCII art to show what's happening vs what should happen
- •Provide the fix: Show the corrected code
- •Explain why: Teach the user what went wrong so they learn from it
- •Check for related issues: Look for similar patterns elsewhere in the codebase that might have the same bug