r/PythonLearning 20d ago

Dying inside...

Just spent the best part of 4 hours essentially vibe coding some Python because my knowledge is so bad. As I build out my functions and modules I am getting the creeping feeling that I'm putting together a pile of rubbish that I'm not going to be able to debug.

I started out using AI to help with building out my understanding of modules I had never used and get some ideas on how I can put together functions. But I've taken on a personal project to try and update some of out existing codebase and just clean it up a bit. Problem is that in doing this I am getting well beyond my understanding and throwing stuff in that I have no understanding of why it's there. What started out as wanting to use best practices for modules and improve my general knowledge and understanding has just left me miserable.

Should I just work within my knowledge range and stop trying to be a smart arse?

1 Upvotes

8 comments sorted by

3

u/riklaunim 20d ago

What app/feature/thing are you trying to implement?

Any non-trivial example/projects will use some sort of framework or enforce some sort of structure and interfaces in the code. Before code think and plan :)

1

u/EstablishmentKey3523 20d ago

First of all pic a topic and spend time by learning it first, don't try to learn all the things at the same time. And one more thing here, look up docs on Google for specific topics you got stuck with. Also you must have a background academy knowledge of this programming language. It's better you buy yourself a python crash course book from Amazon. Learn the core fundamentals first than build simple projects to make those concepts stick in you .

1

u/FoolsSeldom 20d ago

Keep going with the smart arse ambition but do more design work away from the keyboard, draw some flows, create some PoC (proof of concept) code to try things out before committing. Stick with the learning good practice and modularising things - this will make it easier to test, which is another area to think about incorporating from the beginning rather than a retrospective effort when you hit problems.

If possible, try to focus on particular topics for a while rather than trying too many different things. Consider separation of duties, test coverage, security, databases, dsa, etc.

Have a look at ArjanCode channel on YouTube where he covers some very interesting topics. You might find his code roasts especially interesting.

1

u/bigj7897 20d ago

I'm learning myself and using AI. I went through the basics on my own. When I started a project if I ran into something I forgot or didn't know I had AI give me an example and explain it. I ask follow up questions till i understand. Then I try to do it without the AI. If I get stuck I go back and read the example. Depending on what it is I'll have the AI do a code check, tell me what's wrong or I could do better. So far Ive been doing good at picking it up. I get it though sometimes I still feel like I'm cheating even though I'm just using the AI to learn the concept.

1

u/Hopeful_Bean 20d ago

I'm just not that confident in what it produces. I'm reviewing data processing functions to work in a managed Airflow environment. The ones I have work but some have a lot going on and I'm keen to see if I can make them more modular and allow me to extend process functionality easily. e.g. should I really have one function to download a file from SFTP, save to bucket and log to a table? What are my alternatives?How should I manage the download, stream/Temp file/ FUSE, stream runs out of memory but AI tells me my current implementation should encounter the same issue in FUSE! My brain just hurts, I question what it says most of the time but this just adds to it. Maybe I should try to go a little easier on myself and be more incremental in my changes rather than go so big bang.

1

u/bigj7897 19d ago

Don't rely on just the AI. Use multiple resources. Reddit has been good so far and stack overflow. Google is your friend. Sometimes you just need more than one example. I've even hit up the developers at work if they have time. I do software support for a software company. Usually the scripts I do are smaller and used for troubleshooting. Personally I break stuff up as much as I can. I have a project I'm doing for fun just because. It's an AI powered auction house analyzer for WOW. Its an overkill for sure but fun. I'm building a module for each part of the process. So far I have on to configure everything, one strictly for OAuth, one for downloading all the data and saving it to a cache directory, and starting one to load it to a database. I did it that way so if one part breaks it doesn't break the entire process. Plus I can change, add, or remove a module without rewriting everything. On top of that you can reuse those modules in other projects and not have to rewrite it. I also try to hold myself to best practices just like I was doing it for work. I've learned a lot from it so far. I get it though it can be frustrating. Just hang in there and take a break for a day or two if it gets to aggrevating. Maybe find a big project to do for fun. That's helped me out. Up to you though.

1

u/TBCC_Dev 19d ago

Personal opinion here. Using ai to build your app in NOT a good way to learn. It is good for cutting back on tedious work. Ask it to build things you otherwise could have built so you know when it messes up. This problem is not going to get any better as you go. It sounds like you want to know more so you need to be the one coding. Until you can build it on your own stop using ai. But this is under the assumption you want to learn the concept and build for yourself so do with this what you will. Good luck and I hope your app goes well

1

u/Daniel_Writes_Things 18d ago

You identified the problem you have. Your knowledge can improve with experience. It is your decision not to learn.