5 ms·
> It was difficult enough with other people spaghetti code, but being able to generate vast amounts of hard to decipher spaghetti code it only going to make thi
by Sebb767 2y ago
> It was difficult enough with other people spaghetti code, but being able to generate vast amounts of hard to decipher spaghetti code it only going to make this horrible
I've seen some legacy code and the kind of spaghetti humans are able to generate - especially with multiple layers of "I'll just throw in something to make feature X work/fix that bug" - is pretty bad already. I honestly doubt code generation will make things much worse.
- sureglymop 2y agoI do think that people may let code be generated without really thoroughly checking every part of it and I see that as a problem. That, in my opinion is a new "untrusted input" attack vector and it will abused (probably even more easily than how the recent xz backdoor happened), by either targeting the training data, using prompt injection or in other ways. The scary part about it is that any contributer/commuter themselves is considered a "somewhat" trusted entry but if it is assumed that everyone uses code generation AI that entity cannot be trusted anymore. At the same time, since all the AI generated code has to be thoroughly checked/reviewed, the assumed productivity gains are somewhat diminished. I think how it will actually play out though is that security concerns will just be largely ignored as it often goes.
- Octoth0rpe 2y agoI think the difference is that such incidents were previously the exception in a codebase, in the future they will be the rule.
- gryn 2y agoThe difference is in the working memory, a human's is much smaller than a computer's, that leaves room for so much art (In the horror genre).
- patrickthebold 2y agoI fear it will be a quantity issue more than a quality one. Why refactor some code to make it extensible, when AI can write a whole new module from scratch? Don't understand the 10 AI written classes? Leave them be and have AI write some more. Once we get AI code deletion and refactoring I guess it will be ok, but generative models are a problem because code is a liability.
- AnimalMuppet 2y ago> generative models are a problem because code is a liability. I wish I could upvote this many times. This is a major, major problem. AI may get your version 1 out the door faster. But when you try to modify it to create version 2... But someone may ask, "How is this different from any other machine-generated code?" It's different because those tools were built very carefully to generate correct code, and the generated code usually did not have to be modified after it was generated. But when a generative AI is writing the bulk of your application code, neither of those conditions is true.
- thomashop 2y agoI spend most of my time with AI assistants simplifying complex code other humans, including me, have written. They have made me much more efficient at refactoring spaghetti code and removing unnecessary complexity. It all depends on how you use them. They can be a cause but also a solution to a problem that affects human codebases too.