6 ms·
Every time I hear about AI-generated code, I'm reminded of this comment from Linus Torvalds (taken out of context, of course): "You copied that function withou
by jasoneckert 2y ago
Every time I hear about AI-generated code, I'm reminded of this comment from Linus Torvalds (taken out of context, of course):
"You copied that function without understanding why it does what it does, and as a result your code is GARBAGE. AGAIN."
- vips7L 2y agoEveryday life at my company.
- nequo 2y agoCopying functions and not understanding or getting told that it’s garbage?
- MurizS 2y agoFor context: https://lkml.iu.edu/hypermail/linux/kernel/2401.3/04208.html https://lkml.iu.edu/hypermail/linux/kernel/2401.3/04208.html HN discussion (4 months ago): https://news.ycombinator.com/item?id=39191899 https://news.ycombinator.com/item?id=39191899
- Madmallard 2y agoOr, more appropriately, for people that aren't novices using AI "I copied the code because it looks just like what I'd do and oh it knew the library calls I couldn't remember off the top of my head. Let me just fix some of the hallucination here and... all good. That saved me like 30 minutes :)"
- mhh__ 2y agoAlthough I do agree anyway (there are more insidious reasons, mainly in how it destroys thinking) but this is a pretty useless working model of AI.
- mort96 2y agoI don't think the analogy is that AI is just copy/pasting code, but rather that getting an AI to generate code for you and directly using the output is like copy/pasting code.
- johnisgood 2y agoBut to get AI to write you a working solution, more often than not you are supposed to understand the problem at hand along with possible solutions, right?
- ADeerAppeared 2y agoAt that point, you're re-writing the entire solution, albeit without actually typing it out. That makes the AI completely pointless.
- nicklecompte 2y agoIsn't "mainly in how it destroys thinking" precisely what the parent comment was referring to with the Torvalds quote? I am not sure what your disagreement even is.
- liendolucas 2y agoI don't know if it is just me but since this AI "summer" started I have ever pulled a single snippet from any of the available services. I'm absolutely curious what kind of code people are getting from it that is so much more valuable than writting things from scratch and use corresponding documentation, examples or even just source code of the framework/libraries that are needed to accomplish a task.
- chx 2y agohttps://hachyderm.io/@inthehands/112006855076082650 https://hachyderm.io/@inthehands/112006855076082650 > You might be surprised to learn that I actually think LLMs have the potential to be not only fun but genuinely useful. “Show me some bullshit that would be typical in this context” can be a genuinely helpful question to have answered, in code and in natural language — for brainstorming, for seeing common conventions in an unfamiliar context, for having something crappy to react to. > Alas, that does not remotely resemble how people are pitching this technology.
- newswasboring 2y agoSoftware development has gone too diverse. Recently I had a case where I was programming in Matlab I had to use some PowerShell commands. I have no idea how PowerShell even works, but I know enough programming that when phind.com spit out a 4 line script I was able to use it. All this happened in like 10mins. I've done something like this before, almost always trying to work around Matlab limitations, but those cases took a whole day and so much frustration. I like the AI experience very valuable just for the mental peace. Edit: before someone accuses me of doing what trovalds is saying, I understand that code now. I was able to probe the model to explain it to me to the same degree as my understanding of my own code. It was the same feeling as when my team innovated over my previous work and I just asked them how they did it.
- CHY872 2y ago'My customer has given me the documentation to arcane antiquated format X (insert pdf, but it includes 24-bit integers, hex encoded data, semantically signficant whitespace). Here is a sample of the message format, and this struct should represent the contents. Please write me a Python parser which takes an input file in the format and provides the output. In particular, given input X, the output should be equivalent to Y. There should be a set of unit tests for important functionality, which should explain to a reader what is complicated about the format'. is something that ChatGPT4 will just drop out a solution to that works in a few seconds. If your job is to make an accurate parser for it, probably you want to hand code it. If your job is to make sense of the data the customer has provided you with, this is merely an impediment to your actual job, and ChatGPT has you covered. Yes, there'll be mistakes. But ChatGPT can do in a few seconds what'd take you hours.
- bananamerica 2y agoI use GPT for AutoHotkey scripts for personal use. It fixes things Windows can't do natively. I used it briefly for a shell script on Linux but I don't use Linux much these days. When I used Linux daily I had a folder full of scripts I either adapted or copy pasted from the internet. I can't program but I can copy and paste and make minor changes to make a simple script suitable to me. GPT makes a big difference on my day-to-day, Windows 10 is under my control and I didn't need to learn AHK scripting. I'm not in IT, I'm just a regular person with a Hacker News account.
- williamstein 2y agoLinus had a lot of positive things to say about AI and Linux at the end of this recent interview: https://youtu.be/cPvRIWXNgaM?si=dVHbqyeBY8z-MYIH https://youtu.be/cPvRIWXNgaM?si=dVHbqyeBY8z-MYIH
- can16358p 2y agoIt does help in a specific case: where I need to write a very obvious but repeated/time consuming self-contained component. I do know how to write it, but I don't want to write boilerplate stuff again and again, and I want to manage time efficiently. That's when I use, say, ChatGPT to create a React component that is circular and has a click handler (just an example). I know how to do it, I know how it works, I just want to do it faster. And I can verify that it works by simply using the component and seeing it works. Though this is React and frontend. I would probably not blindly do the same for a database connected entity deletion endpoint at a backend.
- sigotirandolas 2y agoFor me the advantage is that for simple cases like the one you mention, it will hardly ever make dumb mistakes like misspelling a CSS property name or missing the return keyword. So it will not only type faster than me, but it often bypasses the "OK, it's not working, let see what I missed" phase. This high-level approach usually breaks down for more complex scenarios, but for those, you can often explain with some detail how you want the code to look like, and it will give you the code and auto-correct any glaring mistakes you made.
- abro 2y agoClassic. ``` [Linux HDD drivers] // sata_promise.c - Promise SATA // Copyright 2003-2004 Red Hat, Inc. [...] // Except for the hotplug stuff, this is voodoo from the Promise driver. Label this entire section "TODO: figure out why we do this" ``` https://github.com/torvalds/linux/blob/0450d2083be6bdcd18c9535ac50c55266499b2df/drivers/ata/sata_promise.c#L1108 https://github.com/torvalds/linux/blob/0450d2083be6bdcd18c95...