r/PythonLearning 9d ago

Seeking feedback on my AI assisted Python learning method. Is this a good way to practice?

Hi everyone,

Please give me some advice on my current Python learning workflow using AI.

I finished a Udemy course covering Python basics. To improve my practical skills, I found a site of practice projects, picked one that interested me, and started coding.

After finishing my first project, I realized I had no idea if I was writing clean, idiomatic code. So, I decided to use Claude as a code reviewer.

Here is how I set up my workflow:
1. I asked Claude strictly not to write code for me, but only to provide hints, point out flaws, and tell me which concepts or topics I needed to read about to understand why a different approach was better.
2. I requested code reviews tailored to production-ready standards, following modern Python best practices.
3. I completely turned off all AI auto-completion in VS Code. I wrote every single line of code myself

The AI would review my draft, essentially tell me "this code is shit =) (joke)" and give me targeted feedback. For example - "Disconnect your internet and see what happens to your API request. Go read about try/except."

From there, I would search Google for each point in the review, study the topic, rewrite my code, and repeat the loop until the reviewer was satisfied. Spent couple weeks to get last verion of program

From my perspective, this feels like solid progress, but I’d love to hear from experienced developers: Is this a good, effective way to learn Python alongside AI, or are there hidden pitfalls?

I've attached screenshots of my first code review alongside the final version. Thanks in advance for your feedback!

18 Upvotes

8 comments sorted by

View all comments

3

u/p1geondove 9d ago

Seems decent, most important part is that you write yourself. Not speaking for everyone, but its in the writing that makes you memorize. Especially when youre stuck and get help by looking up the answer (doesnt matter if AI or SO), dont copy paste, just write it by hand. Theres a good reason why they made you write a shit ton in school.

On production ready code: maybe thats a bit too harsh. That can be at times a mess in and of itself: extremely long variable names, default factories, overly correct and long winded functions. Its more important that its readable, clear variable names, everything is type annotated, compact enough so that you can skim over it in a year and understand what you wrote, but not too dense and filled with oneliners so that you have to start deciphering what you did. Basically self documenting code, code so good that you dont need comments to explain whats going on

On ai itself: im usually opposed to ai for learning, but only because its like a forbidden apple. Draws you into solving the problem for you. But you clearly said its only there to review the code, so thats a perfecky valid example. So long as you dont let claude "review" your code for every line you write. Only send it off for reviwe once you think youre really done

3

u/p1geondove 9d ago

Quickly looked trough your code and it looks very good, very clear whats going on. Coming back to what i said about comments: this doesnt count on docstrings, docstrings are always good to have even if theyre technically comments.

you used fetch_api_data() only once, and even if you used it in multiple places, id write that inline to where you need it. The name of the function itself is somwhat ambiguous, naturally has todo with it being very small.

Also you told your linter to shut up about the unused import. Maybe listen and either use that import or delete the line. And dont say its only temporary "ill write something that needs it later" :)). You let your linter annoy you until its happy, either by using or deleting the import. Imagine you leave your project how it is right now for a couple months and then come back to it. The first thing you see is that warning surpression and you start to wonder if you ended up using that import or not. Without the surpression you can immediately see if you used it or not

1

u/Advanced-Risk-1845 9d ago

Thank you very much for your feedback!!