Most active commenters

    ←back to thread

    258 points signa11 | 17 comments | | HN request time: 0.621s | source | bottom
    1. christina97 ◴[] No.42732390[source]
    > A major project will discover that it has merged a lot of AI-generated code, a fact that may become evident when it becomes clear that the alleged author does not actually understand what the code does.

    Not to detract from this point, but I don’t think I understand what half the code I have written does if it’s been more than a month since I wrote it…

    replies(6): >>42732523 #>>42733051 #>>42733163 #>>42733942 #>>42734578 #>>42734654 #
    2. WaitWaitWha ◴[] No.42732523[source]
    I am confident that you do understand it at time of writing.

    > We depend on our developers to contribute their own work and to stand behind it; large language models cannot do that. A project that discovers such code in its repository may face the unpleasant prospect of reverting significant changes.

    At time of writing and commit, I am certain you "stand behind" your code. I think the author refers to the new script kiddies of the AI time. Many do not understand what the AI spits out at time of copy/paste.

    replies(1): >>42732777 #
    3. ozim ◴[] No.42732777[source]
    Sounds a lot like bashing copy pasting from StackOverflow. So also like old argument “kids these days”.

    No reasonable company pipes stuff directly to prod you still have some code review an d QA. So doesn’t matter if you copy from SO without understanding or LLM generates code that you don’t understand.

    Both are bad but still happen and world didn’t crash.

    replies(4): >>42732862 #>>42734024 #>>42734026 #>>42734792 #
    4. BenjiWiebe ◴[] No.42732862{3}[source]
    LLM can generate a larger chunk of code then you'll find on SO, so I think it's a larger issue to have LLM code then copy-pasted SO code.
    replies(3): >>42733789 #>>42733833 #>>42734592 #
    5. ◴[] No.42733051[source]
    6. elcritch ◴[] No.42733163[source]
    Well LLM generated code doesn't often work for non-trivial code or cases that aren't re-hashed a million times like fizzbuzz.

    So I find it almost always requires going through the code to understand it in order to find "oh the LLM's statistical pattern matching made up this bit here".

    I've been using Claude lately and it's pretty great for translating code from other languages. But in a few bits it just randomly swapped to variables or plain forgot to do something, etc.

    7. JadeNB ◴[] No.42733789{4}[source]
    > LLM can generate a larger chunk of code then you'll find on SO, so I think it's a larger issue to have LLM code then copy-pasted SO code.

    It also generates code customized to your request, so there is temptation to avoid doing even the minimal work of "how do I turn this SO snippet into something that works with my program?"

    8. seanw444 ◴[] No.42733833{4}[source]
    I also think that it would be a nightmare to properly review a large PR of exclusively AI code. If you take the time to understand what it's doing, and find as many little bugs and edge cases as possible, you may as well have just written it yourself.
    9. dehrmann ◴[] No.42733942[source]
    Ah, yes. The good old "what idiot wrote this?" experience.
    replies(1): >>42737636 #
    10. bigstrat2003 ◴[] No.42734024{3}[source]
    > Sounds a lot like bashing copy pasting from StackOverflow.

    Which is also very clearly unacceptable. If you just paste code from SO without even understanding what it does, you have fucked up just as hard as if you paste code from an LLM without understanding it.

    11. bitmasher9 ◴[] No.42734026{3}[source]
    > No reasonable company pipes stuff directly to prod

    I’ve definitely worked at places where the time gap between code merge and prod deployment is less than an hour, and no human QA process occurs before code is servicing customers. This approach has risks and rewards, and is one of many reasonable approaches.

    replies(1): >>42737917 #
    12. kstenerud ◴[] No.42734578[source]
    I can always understand code I wrote even decades ago, but only because I use descriptive names, and strategic comments to describe why I'm using a particular approach, or to describe an API. If I fail to do that, it takes a lot of effort to remember what's going on.
    13. bryanrasmussen ◴[] No.42734592{4}[source]
    agreement here -

    As a normal rule somebody copied code from SO after searching for - unique identifier generator in JavaScript - and the code that was the top answer might not be 100% understandable to them but most of it and it doesn't do anything that is extremely weird. When asked what does that bit of code do they probably say it's the unique id generator.

    Somebody might ask AI write a login module in JavaScript, inside of that will be a unique identifier generator - what does that bit of code do when asked they reply hmm, not sure, it's from ChatGPT.

    14. anonzzzies ◴[] No.42734654[source]
    I have heard that before and never understood that; I understand code I wrote 40 years ago fine. I have issues understanding code by others, but my own I understand no matter when it was written. Of course others don't understand my code until they dive in and, like me theirs, forget how it works weeks after.

    I do find all my old code, even from yesterday, total shite and it should be rewritten, but probably never will be.

    15. thayne ◴[] No.42734792{3}[source]
    It's not very common for people to do drive-by pull requests that just copy code from Stack Overflow on open source projects. I've already started seeing that with LLM generated code. And yeah, hopefully the problems with it are caught, but it wastes the maintainers time and drives maintainer Burnout.
    16. Ntrails ◴[] No.42737636[source]
    Don't forget the revelation 2 weeks later when you realise immediate past you should've trusted deep past you instead of assuming he'd somehow got wiser in the intervening months.

    Instead intermediate past you broke things properly because they forgot about the edge deep past you was cautiously avoiding

    17. stcroixx ◴[] No.42737917{4}[source]
    Yes, I've worked on small teams of highly experienced people where code reviews may only happen a couple times a year for the purpose of knowledge transfer. This is how I've seen it work on what I would consider the most critical and best performing code I've been exposed to. High volume, high stakes stuff in finance and health care.