4 ms·
My fear is that LLM generated code will look great to me, I won't understand it fully but it will work. But since I didn't author it, I wouldn't be great at fin
by notepad0x90 2y ago
My fear is that LLM generated code will look great to me, I won't understand it fully but it will work. But since I didn't author it, I wouldn't be great at finding bugs in it or logical flaws. Especially if you consider coding as piecing together things instead of implementing a well designed plan. Lots of pieces making up the whole picture but a lot of those pieces are now put there by an algorithm making educated guesses.
Perhaps I'm just not that great of a coder, but I do have lots of code where if someone took a look it, it might look crazy but it really is the best solution I could find. I'm concerned LLMs won't do that, they won't take risks a human would or understand the implications of a block of code beyond its application in that specific context.
Other times, I feel like I'm pretty good at figuring out things and struggling in a time-efficient manner before arriving at a solution. LLM generated code is neat but I still have to spend similar amounts of time, except now I'm doing more QA and clean up work instead of debugging and figuring out new solutions, which isn't fun at all.
- unclebucknasty 2y agoAll of this. Could have saved me a comment [0] if I'd seen this earlier. When people talk about 30% or 50% coding productivity gains with LLMs, I really want to know exactly what they're measuring. [0] https://news.ycombinator.com/item?id=43236792 https://news.ycombinator.com/item?id=43236792
- noisy_boy 2y agoI do these things for this: - keep the outline in my head: I don't give up the architect's seat. I decide which module does what and how it fits in the whole system, it's contract with other modules etc. - review the code: this can be construed as negating the point of LLMs as this is time consuming but I think it is important to go through line by line and understand every line. You will absorb some of the LLM generated code in the process which will form an imperfect map in your head. That's essential for beginning troubleshooting next time things go wrong. - last mile connectivity: several times the LLM takes you there but can't complete the last mile connectivity; instead of wasting time chasing it, do the final wiring yourself. This is a great shortcut to achieve the previous point.
- zahlman 2y agoThe way you've written this comes across like the AI is influencing your writing style....
- plxxyzs 2y agoThree bullet points, each with three sentences (ok last one has a semicolon instead) is a dead giveaway
- Jensson 2y agoLots of people wrote like that before AI, AI writes like people its made to copy how people write. It wouldn't write like that if people didn't.
- johnisgood 2y agoYes, I prefer using lists myself, too, does not mean my writing is being influenced by AI. I have always liked bullet points long before AI was even a thing, it is for better organization and visual clarity.
- KronisLV 2y agoI feel like “looks like it’s written by AI” might become a critique of writing that’s very template-like, neutral, corporate. I don’t usually dislike it though, as long as the information is there.
- noisy_boy 2y agoThree bullet points AND three sentences?!! Get outta here...
- noisy_boy 2y agothatistrue I us ed to write lik this b4 ai it has change my life
- 2y ago
- tokioyoyo 2y agoThe big argument against it is, at some point, there’s a chance, that you won’t really need to understand what the code does. LLMs writes code, LLMs write tests, you find bugs, LLM fixes code, LLM adds test cases for the found bug. Rinse and repeat.
- SamPatt 2y agoFor fairly simple projects built from scratch, we're already there. Claude Code has been doing all of this for me on my latest project. It's remarkable. It seems inevitable it'll get there for larger and more complex code bases, but who knows how far away that is.
- saagarjha 2y agoWhat do you do when the LLM doesn't fix the code?
- amarcheschi 2y agoYou tell it there's an error, and to fix the code (/s)
- fuzztester 2y ago>My fear is that LLM generated code will look great to me, I won't understand it fully but it will work. puzzled. if you don't understand it fully, how can you say that it will look great to you, and that it will work?
- Nevermark 2y ago> if you don't understand it fully, how can you say that it will look great to you, and that it will work? Presumably, that simply reflects that a primary developer always has an advantage of having a more reliable understanding of a large code base - and the insights into the problem that come about during development challenges - than a reviewer of such code. A lot of important bug subtle insights, many sub-verbal, into a problem come from going through the large and small challenges of creating something that solves it. Reviewers just don't get those insights as reliably. Reviewers can't see all the subtle or non-obvious alternate paths or choices. They are less likely to independently identify subtle traps.
- raincole 2y agoIt happens all the time. Way before LLM. There were countless times I implemented an algorithm from a paper or a book while not fully understanding it (in other words, I can't prove the correctness or time complexity without referencing the original paper).
- fuzztester 2y agoimo, your last phrase, excerpted below: >(in other words, I can't prove the correctness ... without referencing the original paper). agrees with what I said in my previous comment: >if you don't understand it fully, how can you say .... that it will work? (irrelevant parts from our original comments above, replaced with ... , without loss of meaning to my argument.) both those quoted fragments, yours and mine, mean basically the same thing, i.e. that both you and the GP don't know whether it will work. it's not that one cannot use some piece of code without knowing whether it works; everybody does that all the time, from algorithm books for example, as you said.
- rsynnott 2y ago
- hakaneskici 2y agoWhen it comes to relying on code that you didn't write yourself, like an npm package, do you care if it's AI code or human code? Do you think your trust toward AI code may change over time?
- PessimalDecimal 2y agoPublicly available code with lots of prior usage seems less likely to be buggy than LLM-generated code produced on-demand and for use only by me.
- sfink 2y agoOf course I care. Human-written code was written for a purpose, with a set of constraints in mind, and other related code will have been written for the same or a complementary purpose and set of constraints. There is intention in the code. It is predictable in a certain way, and divergences from the expected are either because I don't fully understand something about the context or requirements, or because there's a damn good reason. It is worthwhile to dig further until I do understand, since it will very probably have repercussions elsewhere and elsewhen. For AI code, that's a waste of time. The generated code will be based on an arbitrary patchwork of purposes and constraints, glued together well enough to function. I'm not saying it lacks purpose or constraints, it's just that those are inherited from random sources. The parts flow together with robotic but not human concern for consistency. It may incorporate brilliant solutions, but trying to infer intent or style or design philosophy is about as useful as doing handwriting analysis on a ransom note made from pasted-together newspaper clippings. Both sorts of code have value. AI code may be well-commented. It may use features effectively that a human might have missed. Just don't try to anthropomorphize an AI coder or a lawnmower, you'll end up inventing an intent that doesn't exist.
- sunami-ai 2y agoWorst part is that the patterns of implementation won't be consistent across the pieces. So debug a whole codebase that was authored with LLM generated code is like having to debug a codebase where ever function was written by a different developer and no one followed any standards. I guess you can specify the coding standards in the prompt and ask it to use FP-style programming only, but I'm not sure how well it can follow.
- QuiDortDine 2y agoNot well, at least for ChatGPT. It can't follow my custom instructions which can be summed up as "follow PEP-8 and don't leave trailing whitespace".
- jampekka 2y agoIn don't think they meant formatting details.
- johnisgood 2y agoIt is supposed to follow that instruction though. When it generates code, I can tell is to use tabs, 2 spaces, etc. and the generated code will use that. It works well with Claude, at least.
- 6r17 2y agoFormatting is like a dot on the i; there is 200 other small details that are just completely off putting to me : - naming conventions (ias are lazy and tent to use generic names with no meaning) such as "Glass" instead of "GlassProduct" ; - error management convention But the most troublesome to me is that it is just "pissing" out code and has no after-tough about the problem it is solving or the person it is talking to. The number of times I have to repeat myself just to get a stubborn answer with no discussion is alarming. It does not benefit my well-being and is annoying to work with except for a bunch of exploratory cases. I believe LLM are actually the biggest data heist organized. We believe that those models will get better at solving their jobs but the reality is that we are just giving away code, knowledge, ideas at scale, correcting the model for free, and paying to be allowed to do so. And when we watch the 37% minimum hallucination rate, we can more easily understand that the actual tough comes from the human using it. I'm not comfortable having to argue with a machine and have to explain to it what I'm doing, how, and why - just to get it to spam me with things I have to correct afterwards anyway. The worst is, all that data is the best insight on everything. How many people ask for X ? How much time did they spend trying to do X ? What were they trying to achieve ? Who are their customers ? etc...
- kadushka 2y agoI wouldn't be great at finding bugs in it or logical flaws This is what tests are for.
- notepad0x90 2y agoThe tests are probably LLM generated as well lol
- nradov 2y agoYou can't test quality into a product.
- ajmurmann 2y agoTo fight this I mostly do ping-pong pairing with llms. After e discuss the general goal and approach I usually write the first test. The llm the makes it pass and writes the next test which I'll make pass and so on. It forces me to stay 100% in the loop and understand everything. Maybe it's not as fast as having the llm write as much as possible but I think it's a worthwhile tradeoff.
- intended 2y agoI think this is a great line: > My fear is that LLM generated code will look great to me, I won't understand it fully but it will work This is a degree of humility that made the scenario we are in much clearer. Our information environment got polluted by the lack of such humility. Rhetoric that sounded ‘right’ is used everywhere. If it looks like an Oxford Don, sounds like an Oxford Don, then it must be an academic. Thus it is believable, even if they are saying the Titanic isn’t sinking. Verification is the heart of everything humanity does, our governance structures, our judicial systems, economic systems, academia, news, media - everything. It’s a massive computation effort to figure out what the best ways to allocate resources given current information, allowing humans to create surplus and survive. This is why we dislike monopolies, or manipulations of these markets - they create bad goods, and screw up our ability to verify what is real.
- eru 2y ago> But since I didn't author it, I wouldn't be great at finding bugs in it or logical flaws. Alas, I don't share your optimism about code I wrote myself. In fact, it's often harder to find flaws in my own code, then when reading someone else's code. Especially if 'this is too complicated for me to review, please simplify' is allowed as a valid outcome of my review.
- otabdeveloper4 2y ago> ...but it will work You don't know that though. There's no "it must work" criteria in the LLM training.
- JimDabell 2y ago> My fear is that LLM generated code will look great to me, I won't understand it fully but it will work. If you don’t understand it, ask the LLM to explain it. If you fail to get an explanation that clarifies things, write the code yourself. Don’t blindly accept code you don’t understand. This is part of what the author was getting at when they said that it’s surfacing existing problems not introducing new ones. Have you been approving PRs from human developers without understanding them? You shouldn’t be doing that. If an LLM subsequently comes along and you accept its code without understanding it too, that’s not a new problem the LLM introduced.
- sarchertech 2y agoNo one takes the time to fully understand all the PRs they approve. And even when you do take the time to “fully understand” the code, it’s very easy for your brain to trick you into believing you understand it. At least when a human wrote it, someone understood the reasoning.
- sgarland 2y ago> No one takes the time to fully understand all the PRs they approve. I was appalled when I was being effusively thanked for catching some bugs in PRs. “No one really reads these,” is what I was told. Then why the hell do we have a required review?!
- sarchertech 2y agoCargo culting.
- np- 2y agoCode reviews with a human are a two way street. When I find code that is ambiguous I can ask the developer to clarify and either explain their justification or ask them to fix it before the code is approved. I don’t have to write it myself, and if the developer is simply talking in circles then I’d be able to escalate or reject—and this is a far less likely failure case to happen with a real trusted human than an LLM. “Write the code yourself” at that point is not viable for any non-trivial team project, as people have their own contexts to maintain and commitments/projects to deliver. It’s not the typing of the code that is the hard part which is the only real benefit of LLMs that they can type super fast, it’s fully understanding the problem space. Working with another trusted human is far far different from working with an LLM.
- madeofpalk 2y agoDo you not review code from your peers? Do you not search online and try to grok code from StackOverflow or documentation examples? All of these can vary wildly in quality. Maybe its because I mostly use coding LLMs as either a research tool, or to write reasonably small and easy to follow chunks of code, but I find it no different than all of the other types of reading and understanding other people's code I already have to do.