r/PythonLearning • u/Ayrton110 • 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.
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.
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.
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?
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