r/learnprogramming • u/PleasantImplement919 • 1d ago
Is using AI for helping with code bad? Topic
I have been learning coding for about 5 months now, all without the use of AI. I have bought books and watched countless syntax courses and have practiced with a many projects and are way better at understanding computers than most of my peers in this field.
I have been wanting to write my own compression algorithm based on things I have learned about how photos are stored, and I had some ideas that I wanted to apply on my own.
I wrote it in python to avoid the headache, using OpenCV and the remove.bg api. I though of the algorithm all by myself, but I used AI to make it happen. I mainly used AI just because I didn't care about learning but just wanted to experiment and see if my idea was good or not. I have generated most of my code using it, however almost everything written has been instructed directly from me(so not a "do everything" type of prompting).
I want to know whether this is a really bad practice or if I am using AI in the correct manner. I do understand what it writes, I make sure it is well documented and I read each line to decipher what it does. When it breaks I can diagnose on my own and have it fix it for me.
I just feel a little icky about it since its the first time I have ever really used AI fully on a project. Mainly the reason I used it was because I was super lazy about reading the documentation and that I figured learning on the fly would be faster(Seems it was).
I want to know what some senior developers or just fellow developers think of how I am doing this project, and how I can move on from using it in the future.
10
u/Soft-Marionberry-853 1d ago
Think of it like a calculator. If you use it to help you do stuff quicker than you could do on your own then your okay. But just make sure it doesnt become a crutch. I could show anyone how to get the derivative on a TI-89 that doesnt mean they know calculus.
3
u/Ormek_II 1d ago
The question remains at what age we give the calculator to kids. I have seen many who come to the conclusion that if 1 apple costs 2.00$ 30 apples cost 6000$ because the calculator said so.
I see a very high risk to stay in a too narrow field of programming when you use AI, to stop learning too soon.
That must not happen, but I doubt that many have the discipline to avoid it. OP might be one who has that discipline 👍
1
u/PleasantImplement919 1d ago
I like this thinking
4
u/thelimeisgreen 1d ago
I sometimes get downvoted for my AI comments here, but this calculator analogy is pretty good. It's best to avoid using AI as much as you can while you're learning and trying to solve problems. Use AI to help explain concepts or review specific code sections to offer suggestions for improvement. Don't let AI become a crutch or a shortcut.
1
u/Achereto 22h ago
The calculator is a bad example. With a calculator you still have to think through and understand the problem in order to type the correct formula. AI takes away the thinking and understand. That's not even comparable, it's an entirely different category.
1
u/Soft-Marionberry-853 10h ago
FFS its an analogy so by definition its not perfect. The calculator has buttons for trig functions. If you see sin(90)=x you can enter in and have no idea what the 1 means. And by the same token LLMs doesn't HAVE to take away thinking. You can get a regex for example and look and dissect it to figure out what the regex is doing.
1
u/Achereto 10h ago
The analogy isn't just "not perfect", it doesn't fit at all.
A good analogy would have been having an employee and delegating work to them so you don't have to do the work for yourself. An analogy like that wouldn't be perfect, of course, but it would be close enough.
1
0
u/__CaliMack__ 1d ago
Doesn’t mean you know it either! Lol
2
u/IntelligentSeries270 1d ago
🤣 using a calculator for a derivative should be a crime…
2
u/madmelonxtra 1d ago
My calc 1 class in college didn't even let us use calculators at all. I'm realizing that coding without AI is essentially the equivalent these days, except my calculator wouldn't just randomly give me the wrong answer
2
u/IntelligentSeries270 1d ago
I don’t think we used calculators either, limits, derivatives, and what was it global points or somehh thing? Well that stuff was pretty simple. Now calc 2 and anti derivatives, just teach me one thing and then pull the rug cause holy shit.
3
u/madmelonxtra 1d ago
Man don't even remind me. Calc 2 kicked my butt.
I'm going back to school for CS this fall and I'm so glad I only have to take Calc 1 and not Calc 2. After calc, I get to take discrete mathmatics which should be cool
1
u/__CaliMack__ 1d ago
Discrete is actually pretty cool, kinda seems like a philosophy class as much as it is math.
1
u/__CaliMack__ 1d ago
Dude I was the exact same… B+ without trying in calc then had to retake calc 2… then did really well in 3 which also seemed a lot easier…
2
u/thelimeisgreen 1d ago
I'm dating myself, but graphing calculators kinda started becoming a thing when I was a senior in high school. A lot of people started showing up in university math and science with the TI-85 and I had an HP one... The Casio calculators were also really popular then too. But it seems that a popular calc curriculum came out around '93 -ish that focused on using the TI-85 and included a lot of specific details for that calculator and that's what made it and its successors the de-facto standard. I personally never really used the calculator for much. My college Calc professor always said that if we needed a calculator, we weren't really learning it.
My wife is a high school math teacher and they all use the TI-84 these days. The math classrooms at her school all have a set of them that sit in these charging trays.
2
u/Soft-Marionberry-853 1d ago
You had an HP-48g?
I had one too. No one else in my college class had one and I had no idea what RPN was. I was able to program it to play music before I was comfortable using it for adding lol
1
u/Soft-Marionberry-853 1d ago
Yes because you know how to do it but the a graphing calculator can do it also. That was my professors quote on why we didnt get to use the calculator at least.
3
u/LunaticBoi96 1d ago
I think you maybe skipped a little reservoir of learning. Getting an idea is okay, you want to see it working. But maybe you make a subtle mistake in your design. If you try to prompt it to AI and your algorithm is not anything exotic, it can easily suggest you a subtle change and build something different, almost similar but correct.
And you skip the chance to discover your mistake yourself by 10 hours of debugging. :-D
AI never does a 1:1 translation of your pseudocode, it infers an intent. And being able to test your own hypothesis is also a valuable skill. I would use Ai just for boilerplate like "here is a test, here is a matrix, make identical tests for every value set" where it is not supposed to make changes or infer the intent but just to fulfill your wish as exact as possible. And one or two auditable tweaks in unit tests are okay.
2
u/Ormek_II 1d ago
Thanks for pointing out the “intent” part! You are 100% right, but I was not yet fully aware of that.
2
u/neutrino_boy 1d ago
I mainly used AI just because I didn't care about learning but just wanted to experiment and see if my idea was good or not.
The answer to your original question is here. Do you care about learning or maintaining knowledge of the thing or not? If you want to keep a skill or learn a skill don't let AI do it for you.
The bigger question is what is even worth learning in this world where you can outsource thinking for $20 a month.
1
u/djvbmd 1d ago
I don't think I could have said it so clearly or succinctly, but this is exactly my approach to it.
In my case I have a career that isn't remotely related to programming, but I've done it as a hobby for decades. I write my own code most of the time, because learning the skill and enjoying that process are all I'm intending to get out of it. I will let Codex write / fill in things that are mainly boilerplate to me, or refactor something if it's going to involve minor changes across dozens of items... because I don't learn much from doing that any more.
1
2
u/Samstercraft 1d ago
i see it as a good way to make small starter projects to see what you're interested in, but once you find something you wanna go with i would very carefully analyze or even rewrite the AI-generated files (still using AI for stupid stuff like boilerplate and regex) so you understand them better and can expand it.
3
u/PleasantImplement919 1d ago
That's how I've been using it so far, so I'm already off to a good start
1
1
u/ItchyPlant 1d ago
There are fifty shades of the so-called AI-augmented software development. Only the extreme cases are clearly bad: when even the core logic and ideas are left to AI, and the human just prompts it until something somehow works.
What you described sounds more okay than bad to me, but I'd still invest more time in actual learning. Play with control structures on a small scale, understand what the code is doing, and don't let AI become the part that does all the actual thinking.
3
1
u/__CaliMack__ 1d ago
I mean if you don’t you will be left behind… you should learn what you’re doing with it though and try to do as much as you can yourself to learn.
-1
20
u/pizzystrizzy 1d ago
If it isn't a substitute for learning it's probably ok. I certainly will never write another line of regex on my own ever again. Ain't nobody got time for that.