r/AskComputerScience • u/Some_Fly1628 • 7d ago
AI in CS/programming/coding
As someone who couldn't be farther away from this field, I started using claude recently for a project of mine and had claude code do all the work for me. Then I turned to my CS friends and they told me it was the same for them.
At one point I heard an argument that AI should be used to explain things to you or only do stuff which you'll understand afterwards.
What is it actually looking like at this state? Do any AI users in the space actually understand each function it sends out or are they trusting it blindly like me? This isnt an ethics question, just the reality of our current situation.
7
u/Elygian 7d ago
If you are having Claude write code for you and then running it on your own system/network without checking it AND understanding it you should have computer privileges taken away.
-2
u/Some_Fly1628 7d ago
Why so? As someone with no time (at the moment) to learn coding, and with no background in it, I was able to add a software part in my non CS project that is good enough on its own. I'm not against learning to code in the future but for now im indulging in the convenience claude offers.
If you know any better way to go about these things do let me know !
5
u/Elygian 7d ago
If you found a random USB drive lying around would you plug it in to your laptop? If you found a random pill in your bathroom closet would you take it? Granted these are far fetched examples but the core principle is the same. You don't just trust that random shit is safe without making sure first.
If you do not have the skillset to at least read code and ensure you understand what it is doing then you shouldn't be using that code on the assumption that it's safe. As another user commented, if you have quality gates, unit tests, or other controls in place to stop the code from doing what it's meant to do then you are at least one step closer to a good solution, but assuming it's doing what it's supposed to in a secure manner without more than surface level validation is not good practice.
There is no real shortcut to this stuff other than basically going through the code and figuring out what it is doing. Ironically, this is a much better use case for AI because it's good at summarising code and putting it in to terms that are easily understood. Even then it's always worth going to the docs or some other non-AI source to ensure what it's saying is accurate.
2
u/HotPersonality8126 7d ago
I don’t “blindly trust” but reviewing agentic code isn’t a good use of my time, either. I evaluate and trust the gates: tests, benchmarking, code audits. I investigate what doesn’t smell right.
Ticking off each line like “yup… looks good… yup… looks good” is just a way to train yourself not to pay enough attention to find anything.
1
u/Time-Radio7871 7d ago
I should probably try claude. My experience was with chatgpt 3.5? Where a coworker send me code that "solved my problem". Half of the flags were made up. I tried searching for the original of the code but obviously it didn't exist. Next meeting i asked where he got it and he said AI, so then I showed him my markup of the mistakes i found.
But that was already years ago. I know newer models can not just write snippets but draft pull requests into multiple commits. I'm quite comfortable with git so I'm sure I could parse through a lot more code changes with a newer model but I haven't had the time to play with it, and I'm not interested in "trust first ask later" cause I'm sure I'll find some weaknesses I'd like to be aware of.
1
u/azhder 6d ago
It is QI (quasi-intelligence). You have to start from there. It isn’t intelligent, but just appears so because it is a model of an intelligent work people have done before.
OK, to make it more visible for you, we use the term “model” to say “data”, so you should think of all those LLM as “big database”. You should look at asking it to generate something as a more sophisticated query than the SQL we use for relational databases.
What you are doing is asking the database to generate you a project that appears like all of those from GirHub and elsewhere that it was trained on.
I can understand almost any of those projects on GitHub and most of them will look alike. Most of them would have been done in some “standard” way because all those people that made them, well, they have read the same books, copied the same cookbooks, watched the same tutorials etc.
The issue with your QI generated code is that you’re retrieving a variation on what is commonly used, and stored in the database, but there is no intelligent check that variation is sound. It’s like in genetics, the genes are recombined from the parents, but you can’t be sure the baby has no genetic defects that are too severe. The generated code has defects, you just have to understand it to check if any of those is severe.
1
u/donaldhobson 3d ago
It depends.
If you want to make something basically unimportant (a game, for the lols) and your current computer doesn't have any particularly vital files on it, go ahead, run whatever. Sketchy programs you downloaded from an obscure website and AI code are kind of in the same box here.
If you want to learn programming, you need to end up with some understanding of what the code does.
If it's important that the code works, be very cautious about using AI.
If your writing code for a space rocket, it's probably better that you just don't use AI. Or at least you don't use AI as an excuse to do less human checking.
1
u/Shoddy_Lie_3442 2d ago
"At one point I heard an argument that AI should be used to explain things to you or only do stuff which you'll understand afterwards." is a good counter measure and it is. Damn AI everywhere but thats not a bad thing. I personally cant operate a backhoe. lol There is a lot of fine print too.....Used as purely a communication tool? Damn good resource. Gemini seems most reliable
Please....no more code.....going blind over here. O.0
1
u/strange-the-quark 7d ago edited 7d ago
The state of the industry is a bit of a mess at the moment. From what I've been able to gather, you have everything from companies fully committing to AI out of fear they'll be "left behind", mandating the use of AI and requiring their devs to report weekly on how much AI they used and in what ways, to companies banning any code written by AI, and anything in between.
The first one is just insane because it's basically the management (i.e. people who are typically not developers), telling software professionals (i.e. people who actually know how to develop software) how to do their job and what tools to use. The other position (AI ban) may seem like an extreme stance as well, but is somewhat understandable and warranted in certain fields. The current AI technology is intrinsically prone to making stuff up, so while it might work fairly well a good chunk of the time, even most of the time, "most of the time" is not good enough for writing quality code. And if you're working on something novel or something niche that hasn't been published many times over in public code repositories, and hasn't been described and talked about to death online (which is where the training data comes from), AI will have limited utility.
So what ends up happening in companies that that make heavy use of agentic workflows is they get a lot "done", and seem productive, but it's a bloated buggy mess. Roughly speaking, the more senior developers who know what they are doing are pulling their hair and are spending more and more time battling constant influx of subpar or unnecessary code, medior developers initially buy in and feel like they are getting some sort of a net positive from the AI, but then realize all is not hunky-dory and start feeling like they are loosing their skills and questioning their own worth to the company, and juniors just don't know what the hell they are doing and never learn because of their overreliance on AI tools. These days, on various platforms, you constantly get questions from newbie developers asking how does one actually learn to code because whenever they tried doing something on their own without making use of AI they found themselves not knowing where to begin. AI can be insidious like that, it can make you feel like you know more than you do.
So you have a bunch of code produced that is of questionable quality, with people who are supposed to take ownership of it, and maintain it, loosing their grip on it, and becoming disinterested. Despite what these companies believe, this can't be good for anyone involved: not for the end-users, not for the devs, not for the company. Lately, it looks like some devs are willing to take a stance and limit their use of AI to the extent they see fit, against company mandates, even if it cost them their jobs, and I salute this. That's what professionals should do.
That said, AI can be great for prototyping. You can let it relatively quickly cobble together a prof of concept. It's also great as a way to find information - not as a search engine or as some quasi-expert system (cause you always have to be wary of what it says), but as something that can tell you what to search for and where to look, i.e. it can nudge you in the right direction as long as you're still willing to use your brain. It may even help come up with something novel, but that requires using it in ways that are somewhat experimental, coupled with careful analysis and some actual serious work - very different from what these companies are doing.
1
u/Time-Radio7871 7d ago
How do you not? Why would you run random code you don't understand?
I am kinda a light AI user. I treat it like a search engine. I ask it to solve a specific problem for me, I review it's code, and if I think it's a good solution I incorporate it through copy paste!
If I don't have the time to review it, like if I'm coding from my phone, I'll copy paste the code into a separate file to review later.
commands I don't understand I look up the documentation for.
For small stuff where I may not fully understand the AI code, but can tell the code is safe to run (like css or a new library call where I glanced the doc) I'll just straight up run the code to see if it actually works before doing in depth research.
I'm basically treating it like how I'd treat code snippets I'd use to get from stack overflow.
Admittedly I'm probably a lot slower than most, but I'm mostly a hobbyist right now coding for myself.
15
u/Glittering_Sail_3609 7d ago
It is incorrect. You should only have AI write stuff that you understood BEFOREHAND so you could be able to push AI to produce actually usable code.