S
17

Changed my mind about using AI for debugging after one weird trick

I used to think asking an AI to fix my code was cheating or would make me a worse developer. Then I spent 3 hours stuck on a loop error in Python last Tuesday. I tried reading my code over and over, googled the error message, still nothing. A friend told me to copy paste just the broken function into ChatGPT and ask it to explain what's wrong step by step. I did that and within 30 seconds it showed me I was resetting a variable inside the loop by accident. It wasn't magic, it just caught what my tired eyes missed. Now I use AI to double check my logic after I write the code myself first. Has anyone else found a specific way to use AI without feeling like you're skipping the learning part?
2 comments

Log in to join the discussion

Log In
2 Comments
aaron884
aaron8847d ago
Pretty much the same thing happened to me with a for loop where I was appending to a list instead of creating a new one each iteration. Spent like 45 minutes staring at it until I pasted it into an AI and it pointed out the typo in like 10 seconds. Now I use it as a rubber duck that can actually talk back, saves me from those "why is my code making burgers when I asked for pizza" moments.
2
nathanj56
nathanj566d ago
Wait, you're telling me it took you 45 minutes to find THAT kind of bug? @aaron884 I feel that so hard though, I once spent an hour debugging a script that was just a single indentation level off.
8