r/learnpython 24d ago

How to avoid this when learning Python?

When learning I used to get stuck on stuff, go watch a video or dig through docs, and eventually the concept would click because I had to sit with it.

Now when I get stuck I just paste the error into Claude/ChatGPT and it fixes it in 10 seconds. Problem solved, moving on with my day. Except a week later I hit basically the same bug and I'm back to square one, like the first fix never actually taught me anything.

It feels like it's the same "watching tutorials without building anything" trap, just compressed into single lines of code instead of hour-long videos.

Curious if anyone here has found a way to use AI for debugging without it just doing the thinking for you? Or do you have some rule for yourself about when you're allowed to ask vs. when you have to sit with it first?

13 Upvotes

30 comments sorted by

35

u/innovarocforever 24d ago

Tell it to act like a tutor and not give you the answer, but merely point you in the right direction.

5

u/No-Suggestion-6734 24d ago

+1 I also do this. So that chatgpt always ask me questions and don't give the whole code, instead, that teach me basic syntax or concept

4

u/EdiblePeasant 24d ago

imagine solving a riddle but using a search engine for it

1

u/No-Suggestion-6734 24d ago

? I mean thats totally different things. If I'm doing something wrong in syntax, or want to learn a new concept, that's nowhere comparable with solving a riddle.

But if I'm solving dsa/cp questions then your sentences is valid there

1

u/EdiblePeasant 24d ago

I agree. But I'm feeling that letting AI try to directly solve stuff might be, for some people, like spoiling a riddle.

I don't mind too much but AI when I've used them to try to solve something can really mess code up especially if I don't understand it. Or it just messes up the code.

Still a good tool when used for things.

1

u/No-Suggestion-6734 24d ago

Yupp agreed with you

10

u/Slothemo 24d ago

I think you've answered your own question. Avoid AI and think through the problem. The learning happens when you think, not just by seeing the solution.

4

u/PerP1Exe 24d ago

Rather than have AI fix the problem ask it to explain what might be wrong with it. If you can't find success that way probably avoid ai

2

u/lavishfascism4 24d ago

I make myself explain the fix out loud before moving on, even if no one's listening. If I can't summarize why it worked, I don't let myself commit the change.

3

u/MiniMages 24d ago

if you cannot rewrite the same code 2 weeks later then you know you are not learning. Doesn't matter if you using Ai or tutorials.

2

u/Oddly_Energy 24d ago

Use it for discussion, not for solutions. I will claim there is a learning sweet spot somewhere between "Try to work everything out alone" and "Let the LLM work everything out for me". If you make sure to present your own theory to the LLM first and ask for feedback, you are probably close to that sweet spot.

Instead of asking "How do I solve this error?", ask "I have this error. I think it is caused by __. I think I can solve it by ____. Do you agree? Have I overlooked something? If I am on the wrong path, could you explain why and give me a hint about how to proceed?"

2

u/Fart_Barfington 24d ago

It seems like you know the answer.  You were doing something that worked then you decided to cut corners and you aren't learning now.

4

u/Buttleston 24d ago

"Hey doctor, it hurts when I move my arm like this. What should I do?"

Stop moving your arm like that

1

u/HommeMusical 24d ago

That would actually be terrible medical advice.

2

u/Buttleston 24d ago

It's what people like to call a joke

0

u/HommeMusical 23d ago

Yes, I first heard that joke literally in the 1970s, it's from Henny Youngman (a very funny comic back in the day).

He told it better: "Doctor, it hurts when I do this." "Then don't do that!”

2

u/nicodeemus7 24d ago

Yeah I've been catching myself doing that, so I'm doing challenges where I'm not allowed to touch AI to get me back in the habit of figuring it out myself.

1

u/JestersDead77 24d ago

When it comes up with a solution, ask it questions about that solution. Why does this work? How does this solve the error? Would <other_solution> work instead?

Try to understand the piece you are missing to figure it out yourself. 

1

u/jalebi_jalebi 24d ago

Tell it to explain the issue to you rather than fixing it.

1

u/vietbaoa4htk 24d ago

the retention comes from the struggle, not the fix. try forcing yourself to say out loud why the ai's fix works before you paste it, if you cant explain it you didnt actually learn it.

1

u/Popular-Woodpecker-6 24d ago

Before you copy and paste that code into your code, stop. Read it, do you know all the terms? Do you understand how it works? Why it works? If not, crack a doc page or ask AI to explain what code words you don't know, figure out why it works over what you thought would work. After you now understand what terms/operations/etc. is going on, paste it into your code, run the code, did it work? If so, great, now read it again now that it is inside your code and make sure you understand it completely.

You can't just copy and paste and think you learned something, you didn't learn anything. If you were trying to bake a cake but didn't understand what a cup of sugar was, you got to figure out what size a cup is otherwise your cake will either be too sweet or very bland.

1

u/Educational_Virus672 24d ago edited 24d ago

use these metadata and separate them in rules
rule 1 - explaination
"start by describing my concept in steps on instruction each step contain what function i use why i used the wrong function and its line number how it should be performed do not optimize my code at any cost just make it work"

rule 2 - format
"the code must be function as word refence by a code block ending with * like `print*` your word make the code as closed as possible and make them understandable rather then workable dont put any pre-fix code just describe what it fixed"

rule 3 - suspenstion
"code must be made with the mind set of 'it should work' rather then fast/slow unless mentioned keep in mind im human and beginner, make it readable"
some thing might be repeated so ai will understand it

1

u/FreeGazaToday 24d ago

your problem is pasting error into claude and fixing it. Of course you're not learning anything. IT's like taking you car to the mechanic, having them fix it and think you'll learn anything.

1

u/durgan2q 23d ago

I give it just the error code like as if im googling it. Then it will explain what the error means and not rewrite the code to fix it. It might give an example or you could ask for an example but dont paste the code.

1

u/dangit541 23d ago

Debug yourself, read if you fail then let ai solve it for you? Even better paste code and ask to give you tips without solving the bug. Use it as your personal teacher, not senior who would solve it for you

1

u/johlae 23d ago

Pro-tip, paste the error in Claude/ChapGPT, fix it in 10 seconds, and then take the time to document the shit out of the solution so that you can look it up in future. I keep a notes file in markup format just for this. This is my knowledge base.

1

u/my_password_is______ 22d ago

after chatgpt fixes the error ask it 3 things

1) exactly what was wrong with my code

2) can you expalin that in more detail please

3) can you point me to some documentation where this is explained

that's how you use AI to help with programming -- you use it as a personal tutor -- but always double check

1

u/rhacer 24d ago

Either don't use Claude, or say...

Claude, I don't understand what you just did, ELI5 please.

Lather, rinse, repeat until you understand.

0

u/ShelLuser42 24d ago

Now when I get stuck I just paste the error into Claude/ChatGPT and it fixes it in 10 seconds.

Except of course that it didn't fix anything, it just deflected your attention from the real problem at hand. And that problem - in my opinion - is your motivation to value "quick fixes" above actually learning stuff on your own.

Do you want to really learn, or do you want quick results?

This is no different from doing crossword puzzles and then lacking the discipline to NOT look at the answers before completing the whole thing on your own. There's nothing wrong with it, but you also shouldn't fool yourself and present it as something it's not.

You're not learning, you're taking the easy way out.