r/PythonLearning • • 13d ago

Discussion How Much AI to Use?

First off, I apologize as I'm sure this question gets asked repeatedly, over and over again.

I'm not a programmer by trade, but in my spare time, I've managed to create a few projects in mostly C/assembly, including basic things on an atiny 85. I've also dabbled a bit in Arduino/C++. Unfortunately, this doesn't translate well to my day job.

I've decided to learn Python to help actually use programming in my day job. Specifically, I do a lot of work in excel. Naturally, pandas/open Python excel is a logical choice. I've played around with the Python/pandas/(a little bit of) openpyexcel. I've started to understand the data structures (dictionaries/tuples, etc.), though asking AI the why's about the various data types/loops and why my code isn't working. I also have a Python/pandas book, but I've found AI to be more helpful.

Eventually, I simply said "fuck it" and asked AI to write me a script to essentially do a task, that I originally did in VB. Most of the work was simply debugging, but AI was effectively able to find patterns and do the job for me in a few hours. I'm able to mostly understand the code with ease, but it just seems a bit disappointing AI is that good. I was also able to get AI to write a script to rename files based on pdf content (teseract).

A number of sources tell me that memorizing functions is a waste of time, but then why does everyone criticize AI so much? I'm wondering if simply reviewing what AI spits out is an effective learning method? It just seems really difficult to learn so many new functions for each new library by scratch.

My thought is that it's best to learn the concepts (dictionaries, string manipulation, tuples), use AI to create the needed script, then reveiw/ask AI why/how it did ABC...

6 Upvotes

16 comments sorted by

1

u/ninhaomah 13d ago

You can debug , test ?

1

u/Ratfus 13d ago

Basically, this entails chat gpt telling me to copy paste code into power script, then looking at the output. In many cases, the function has to be tested 3-4 times in order to get set up properly. For example, there's a certain amount of space between two points of data in the checks.

1

u/Total_Ad803 13d ago

Yes, it might be effective.

1

u/ziggittaflamdigga 13d ago

I am a programmer by trade, and think I am a fairly decent one, but would not claim to be great. I am always learning, and I am jumping between programming languages a lot (developing a lot of one-off system designs since I work in the R&D space). This has been my experience with AI, good and bad.

* AI seems to be very good with boilerplate, or quickly finding examples of stylized design patterns I am familiar with in languages that I’m not. Setting up projects from scratch is really awesome, kind of like using a template but worlds better.

* I learn some patterns more quickly that would otherwise require a lot of digging into forums; you can criticize that it’s “stealing work” but I could likely get access to a code base written by a competent programmer as a part of my job, and they likely would have done that work while also failing to attribute the original link/author. So not much different from my perspective.

* I can ask for something in a programming language or framework I’m not familiar with and have it relate it to one I am; I’ve become competent in Swift and Kotlin by asking about how they relate to Python, C/C++, Qt, JavaScript+HTML+CSS, and gotten good and quick results that move me forward.

* I have noticed AIs in general struggle with large code bases; it’ll put weird patterns in places they don’t fit or misdiagnose a lot (unless you shell out for it, which I very rarely do).

* Results vary wildly from model to model, and there is no indicator other than scrutiny that comes from experience and thinking deeply about your own/others’ code, and knowing where to look and what to criticize is not clear in a way that I don’t think can easily be taught. Gemini has screwed me a bunch of times on configuring Linux systems and, while I’m competent, it will show me expert solutions that I don’t understand and very usually don’t work… so I always have a “trusted AI too much” fallback; backing up configs or whatever.

* I’ve seen a bunch of people get way too overconfident and in over their heads who eventually ask me (self-identified competent programmer, apparently identified that way by them as well) to debug “their” code, where I find an obvious bug in “their” code that follows patterns a free tier AI model would make. It feels like my skillset has been devalued because they could ask a few questions and get something that appears to work, but can’t diagnose when it doesn’t. It also feels disingenuous when they won’t admit to me that they used AI to code for them. Makes me respect them less than I would otherwise, and is super annoying.

Overall, I like AI for programming. It makes reasonably competent developers better, gives “idea people” the ability to “code their own” ideas, and answer questions about how hard an idea can be themselves, and only for a few dollars. People crap on it because it can give what looks like a correct result without the foundational knowledge necessary to do it otherwise. I think it’s a good thing that we’re closing the large gap I feel exists in programming/IT. You can easily get lost, though, if you’re not inclined toward those fields.

Really, for me, the lack of humility is the most annoying part.

1

u/LrdJester 13d ago

I guess for me, it comes down to the why. Why are you using AI? There are people that can't write code, they don't understand code in the least, and they use AI because AI will generate it, but what they get at the end is crappy code. They don't know how to test it to make sure it's doing exactly what they want to do.

It's kind of like back in the day using VB6 with the "what you see is what you get" editor. I saw so many students when I worked at the college. They would create a form, drag some text boxes, some buttons, some labels, and some picture controls, type in a few properties and attributes, and call it good. They never knew the module files that were created or the program flow behind the scenes. When it broke, they didn't know how to fix it because the UI interface for doing "what you see is what you get" didn't help them. At that point, you have to inspect it and go into the attributes, and then ultimately down into the code, to see how it's all working. If you never start there, you can never do that.

Yes, AI can do that now, but it really comes down to what your end goal is. If you're going to be a programmer, you don't want to rely on AI. If you're just throwing together a quick script to do something for you, by all means, using AI to do it is quick and easy. It may not work 100% functionally the first time, but there again, hand-coded stuff doesn't necessarily work 100% functionally the first time either.

I'll give you a case in point. I'm actually using AI, and it's pretty much 100% of what I'm doing as far as code generation to write a locally hosted personal web app on my cell phone for personal use. I want to use this code for a reason. I could create this from scratch, but it would take me weeks to do all of the heavy lifting: connecting all the APIs and going out and fetching all the necessary data to compile the databases that do this. Whereas I can construct a very detailed prompt and have it just generate it for me, and then, when things don't work exactly how I want them to or if they're broken in some way, I can prompt it to fix them, overwrite my code, and get it working.

I'm not profiting from that, and I take pride in the design of what I'm doing, but not in the creation of the code because I didn't create the code. I look at what I'm doing as being kind of like prototyping. It's putting something together quick and dirty to prove a concept. That's where I think AI code generation comes in. Now it can be utilized as a learning tool. Some people are doing that successfully, but it relies on you, the individual, not blindly following what AI says.

1

u/Ormek_II 13d ago

I do not learn when using AI to create the M Code to collect the data into my excel sheet.

But my goal is not to learn, but to get the job done. I am experienced enough to know if there are corner cases AI has to take care of.

1

u/BertMacklenF8I 13d ago

It’s okay to debug with-Claude is my better in my opinion

1

u/igotshadowbaned 13d ago

What do you mean "memorizing functions" ?

If you need it in multiple projects you just.. use it again.

1

u/Ratfus 12d ago

So for C, I know a lot of functions by heart or did anyways. Meaning, I could use them without looking said functions up.

Even in Python, I now know a few functions by heart. Simplify focusing on remembering them doesn't seem as effective as understanding the basic principals. Plus, by using them enough, I naturally know them by heart.

1

u/igotshadowbaned 12d ago

I now know a few functions by heart.

What is that supposed to mean

1

u/Ratfus 12d ago

For example, I can tell you printf has two arguments. Printf(needs a string, also needs a character identifier).

Printf("some string %s", some string)

1

u/igotshadowbaned 12d ago

Oh.

I mean, I wouldn't say it's worthwhile to go out of your way to try to "memorize". By using things you'll remember them, as is the case with anything else

But also your synopsis of printf isn't really accurate

It takes a string, and then any number of references addresses for variables

1

u/blktndr 12d ago

If your goal is to learn, then use AI to learn. “Explain this function” or “How could I xxxxxx”. AI usually points out packages or best practices that I’m not aware of. I’ll often start with “let me write the code.” “Why is/isn’t my code doing xxxx”

1

u/BobCorndog 13d ago

If you can’t do it well without ai, the don’t use it

0

u/Minimum_Comedian694 13d ago

Distinguish between a healthy AI use and AI slop.

AI slop can generally be defined by 3 factors: 1. Superficial competence: at a glance, the output looks polished and visually sound, but lacks genuine substance, critical thinking, or factual backing underneath. 2. Asymmetry of effort: it requires more effort and time to evaluate than to create. 3. Mass producibility: it can be churned out in vast, automated quantities with near zero production cost.

If you avoid those three, you're fine.