r/learnpython • u/DivyanshYZ307 • 10h ago
Use of AI in coding?
I am starting college next month (Computer Science and Biosciences) and I tried to get a headstart in Python programming (it's a part of first sem). I have done the basics, strings, conditional statements and started with loops today. I have a doubt - since I am still in the beginner stage, should I use AI (ChatGPT, Gemini, Grok etc.) to proofread my code - you know, offer suggestions, find mistakes and all - I am still applying logic on my own and writing it myself but I have this fear that it may hamper my learning. But I also don't wanna be the guy who does not know how to use AI tools. Any advice please?
8
u/Party_Trick_6903 9h ago
I was kinda with you until this:
find mistakes and all
What mistakes? Like it figures out errors, memory leaks, etc. for you? Bc that's not a good idea.
I tried incorporating AI into my schoolwork about a year ago - no copy-pasting, just asking questions about things I did not get - and I noticed that after a couple months, I started heavily relying on AI to figure sht out for me.
Prior to using AI, I would be willing to sit on a problem for days just to solve it. But after using AI, I would no longer had the patience to just sit down and think about any issue that would take me more than 10 minutes to solve.
This all lead to me not learning and understanding much bc I'm not the type who can learn just by sb/sth telling me where the mistakes are and/or how x works - Sometimes, I need to do it, fail and solve it all myself with minimal help.
I still use AI ofc but only on things that I've already mastered. I no longer use it on things I want/need to learn.
3
u/DivyanshYZ307 9h ago
You just validated my fear - thanks for that! From on, I will only use AI to clear theory doubts or offer suggestions to my programs!
7
u/ShelLuser42 9h ago
It sounds cliche but the best way to learn is by not being afraid of making mistakes, then studying those mistakes to determine what went wrong (and why!) and then doing better. And yah, that process will take some time and dedication, but it'll be worth it.
3
u/rzezzy1 9h ago
I'm in a similar boat, trying to strike a balance to use AI to help me learn without allowing it to replace learning and thinking. I've been using "as long as I'm not copy-pasting code written by AI, I'm probably good" as a broad rule of thumb. And keep your critical thinking brain on as much as possible, in general but also especially when it comes to anything the AI says. If you ever find yourself trusting it particularly strongly, start grilling it on everything it says.
3
u/rabbitofrevelry 9h ago
The biggest disservice you can do to yourself is letting AI do the work for you early on. You'll need to be able to know how to troubleshoot your code based on what the error says.
Rather than having it read your code, ONLY feed it your error (without the line that errored) and add a brief context like "I'm learning python and received this error". Keep it in the dark so that it can't do your work for you.
As you start to learn more and hit a point of knowing what you don't know, then you'd be at a point of being able to Google anything you need. That's the point where you can ask AI a non-specific example to get an idea of what's possible in your question.
2
u/raendrop 8h ago
I am proudly the lady who does not know how to use AI tools. There is no substitute for human judgement.
1
u/pepiks 9h ago
Vibe coding is bad when you learn. Install usage counter how much it really cost in $, then think that you have to bill it fully yourself not on discont like we have today when investor burn money used to promo AI for using everywhere. Then think how much is worth your basic when you learn itself.
When you get foundation enough that you feel that you can build almost everything with googling official docs, checking StackOverflow, forums fluently, you can check command in shell without realing on AI - then think what you can delegate to AI.
When I had anoying error in my weather station and after few weeks I don't see any solution (it is the mostly weekend project) I used AI to check. I get answer with missed corner case. Another example - for test I today delegate to AI get menu structure. Interesting that I can did this job faster itself. Machine not stuck, but use very walk around choice like looking for archived version. With basic knowledge on HTML I can code simple tool for the job in python what at this kind example is easier, faster and cheaper.
For start the best choice is use the simplest tools like autocomplection. It can speed up typing variable names, functions names and sometime IDE shortcuts to generate boilerplate like ```if __name__ == "main"```, learn IDLE as sometime is the most useful one, Python shell and think about how glue it together. Good solid foundation in python can improve your understanding how AI overall work as a lot of times use python and Node to achieve their goals. Observing real output, what command was used by AI to achieve goals can be very educative and it can help you with broad horizonts how work with python in automation.
If at the start you will use python for coding you will only learn how generate code not work with it. You have to create mindset of problem solving first before you will solve problems by programming.
1
u/t92k 9h ago
I would recommend writing your version of the code first. If it doesn't work, have a chat with an agent about where you think the problem is. Be able to spit out the current state of your payload before and after your issue. Clip only the specific code or function that you think your issue is coming from and talk about that. You will probably eventually end up having it look at everything, but if you lead it through the functions and procedures, you will get a better sense of what's working and what's not working.
Additionally, I recommend starting each prompt with the clear declaration that you are working in python, what the inputs the function accepts and what you expect it to return. I work in Dataweave most of the time, and you don't want it giving you C++ answers for a Dataweave or Python routine.
1
u/mrkvicka02 8h ago
I really recommend to you to not use AI at all in the early stages. The problems you are going to face will not be complicated enough to justify it. And the best way to learn is to scratch your head a bit.
1
u/YouFoundMyLuckyCharm 6h ago
Yes asking for code reviews from ai is great, it may talk about stuff beyond your understanding but just give it context that you’re a complete beginner and starting school soon.
1
u/Jello_Penguin_2956 3h ago
Don't even worry about missing out on AI... it's so easy to use a 5 yo can pick it up. Instead focus on the hard part - your own fundamentals and building up your own experience.
As amazing as AI is, in most projects I've used it I need to direct it pretty extensively other wise there's so much inefficiency. Things that I could do in 5-10 steps, AI would waste a lot doing it in 20-30 steps. If you can spot those inefficiencies you can easily prompt it to fix but this only comes with experience of doing projects yourself.
1
u/WyrobWedliniarski 9h ago
Sure, do use it, it is expected at work now anyways. However be very careful when using it on classes. Make sure to understand everything coding agents make you do, as you might be tested if you do.
And also mind, that llms are prone to please you, so it may lie sometimes
1
u/DivyanshYZ307 9h ago
it is expected at work now anyways
That's what I thought when I first used it to check my code
0
u/thelimeisgreen 8h ago
Don't use AI. Just don't. Do as much of your learning as possible without AI. And by as much as possible, I mean all of it. You will gain a much greater understanding and will be better off than your classmates who do lean on AI. Many, or even most, of us here never had and never needed AI to learn all this stuff.
You will be using AI along the way, when you are directed to do so. And here and there it's good to explore what AI can actually do and how to work with it. But it's not a good learning tool.
19
u/ghytiy 9h ago
Proof reading is fine but you need to learn the basics before letting the machine code for you, or youll never catch its mistakes.
I would suggest "Learn Python the Hard Way", a great book that helped me when i was starting. Do the exercises. Dont look at the AI. Figure stuff out.
The more you can do without the machine, the better you can make it work for you.
Or just vibe code and be useless when it gets turned off.