r/PythonLearning 2d ago

How fix/resolve critical thinking after relying on the ai prompt to understand an exercise in counting loops.

Hi guys, I trust ya'll are good. I recently completed a counting loops exercise that had been difficult to answer for nearly two weeks. I checked different parts of the code I wrote in multiple instances, but I guess I just didn't get it. I eventually asked in my search bar (knowing that I would more than likely get AI mode on it) why the loop is only executing once (I pasted my code it). AI mode explains it, and shows me the correct code. I'm really annoyed on two fronts; I had to refer to AI code to eventually get it right, and the answer looks so friggin simple. I am not a complete beginner in coding (closer to an experienced beginner), and having to vibe-code, even if somewhat unintentionally, is frustrating. I know the answer to the problem now, and there isn't a way to unlearn it.

Is there any practical way to resolve this other than "just don't do it again"?

Thank you for taking the time to read my post. I appreciate whatever advice or input you have.

1 Upvotes

17 comments sorted by

3

u/WaterDiligentq 2d ago

AI is a tutor, not the answer key. Next time: ask it to explain 1 line at a time, not give the whole solution

1

u/Ayrton110 2d ago

Thank you for your advice. While this is useful and pragmatic input, my challenge is that I don't want AI to be the tutor either. I want to resolve my critical thinking after the vibe-coding I subjected my to. The real question is, I guess, "how to fix vibe-coded thinking?"

2

u/NocturneSapphire 2d ago

AI and "vibe code" aren't the same thing. "Coding" by copy/pasting AI-generated code is vibe coding. Asking the AI to analyze code that you wrote and tell you where you went wrong is not vibe coding.

The key point is that your goal, the thing you need from the AI, should be understanding, not correct code.

Don't say "here is my code, fix it", instead say "here is my code, explain to me why my code isn't working". You can even tell it "don't generate any new or edited code" to prevent it from outright giving you the answer.

Ask the AI questions, and actually read the answers it gives. It might be wrong of course, but there's a pretty good chance it'll actually give you a decent explanation. Then you can take that explanation and use it to fix your own code.

Your understanding of why your original code was broken and especially why your fix works should be the ultimate goal.

1

u/subnu 2d ago

Go back to the basics - print statements. Print out the values at each loop so you understand each iteration. If you still don't get it, more print statements.

1

u/Sea-Ad7805 2d ago

Or better yet, use AI only AFTER you completed an assignment for feedback and do not let it do any of your thinking before completion. Assignments are generally broken down into small, incremental steps, so students can complete them using only the course material, without AI or web searches.

3

u/codeguru42 2d ago

When you start a coding exercise, turn of your computer and solve the problem by hand with pencil and paper. Work out some examples. Then describe the steps to solve the problem in words.

3

u/dld2517 2d ago

Yes this. And make a flow chart. This is how I learned to program. Pseudo code, flow charts, stepping through code, writing down counter values. It makes debugging so much easier.

2

u/fjohn9999_ 2d ago

What I usually do is plan beforehand using pseudo code and then note down what I don’t know to search them on Google, stack overflow, etc.

I only use LLM as a Mentor/code reviewer and strictly tell it to use pseudocode when it’s supposed to use code snippets.

Note: I got the planning process using pseudocode written in markdown, dm if you wanna it

1

u/dld2517 2d ago

I don’t understand the problem, how can I suggest a solution.

1

u/Ayrton110 2d ago

I apologise if this seems vague. In short "How to resolve my critical thinking skills when I just relied on AI to answer the question (that took more than a week to answer) for me?" Are there any platforms that force your coding skills to improve in a way that fixes initial "vibe-coded thinking"?

1

u/animus_95 2d ago

Just exercise more. You will come across more difficult problems and then you can sharpen your critical thinking with those.

Just don't look up the solution with AI next time, try forums or wiki pages for code.

But I wouldn't completely refrain from using AI - because I don't see much difference in copying a code from an old forum or copying it from chatgpt, as long as you tried hard beforehand, understand the solution offered and keep coding mostly in your own style instead of just using AI code.

2

u/dld2517 2d ago

This.

1

u/dld2517 2d ago

One thing you can do is go read TAOCP or go read a book that is like “40 problems to master the technical interview” or 100 computer science problems. Or go read the book “Concrete Mathematics”. Something that will help you with the process of generalization or abstraction. It just takes practice, practice, practice.

1

u/programgamer 2d ago

Yeah, it's pretty much just "don't do it again" and "ask actual people next time".

1

u/FoolsSeldom 2d ago

I'm sorry, but "just don't do it again" is pretty much the answer, but just like saying to an alcoholic "just stop drinking", it will not be that helpful.

One practice that many recovering alcoholics try to follow is avoiding places where alcohol is readily available / sold. I am sure you understand the analogy.

Another approach is to switch to drinking soft drinks and learning to enjoy them. The analogy here is to learn to use LLMs differently. You can give them standing instructions on how to help you to include telling them not to give you code that solves the problem but instead to guide you on the problems and explain certain concepts to you. A useful trick is to tell the LLM to always start responses with your name. If you stop seeing the name, the context has been lost, and it will likely stop following your instructions, so start a new session.

As you have realised, we learn best from trying things and making mistakes.

1

u/SeanSmick 2d ago

This use of AI for learning sounds fine in my opinion. You had a problem, you struggled with it for a time, and after multiple attempts (learning from each one whether you realise it or not) you asked AI. It told you the solution, which you immediately understood the solution and understood why your attempts weren't good fits.

I get the frustration of you wanting to unlearn the answer to come up with it yourself, but you're fine. Back when I was learning in uni, a room full of now senior/staff engineers needed help from tutors with basic answers. You're getting there. You needed help getting the answer, not so much understanding it, which is a good sign imo.

1

u/FilmWeasle 1d ago

I don't understand what the problem is. It sounds like you learned something from AI but you have personal objection to using AI for learning. If this is the case, I think you're shooting yourself in the foot by not using AI to learn. Is there some stated rule that you're not suppose to ask AI?