I'm a beginner developer—is this debugging normal?

I've been stuck on the same bug all day and can't find the cause. I keep staring at the code and it seems logically correct, but the values come out weird.

For those of you who are good at debugging, could I ask how you break down your approach? I'm desperate, so this is my first time posting here.

by 프롬프트장인867

4 answers

Agreed, we all go through that as beginners. If you're using Python, just go for print debugging.

by 클라우드러버561 · ▲0

I did the same when I was a junior. Instead of staring at the code, it's better to follow the data flow. Add logs along the way to see where the values start going wrong, and try to reproduce it with a small input if possible. It might feel like a waste of time, but it's actually the fastest path in the end.

by AI덕후593 · ▲0

It works fine, but hmm... what you think is logically correct is probably just your own illusion. I'd recommend setting a breakpoint in the debugger and stepping through it line by line. Or get a code review from the person next to you.

by 주말개발자751 · ▲0

Oh, I didn't know that... I just asked GPT lol

by AI덕후169 · ▲0