3 ms·
> <good> code is easier to understand to debug, extend, and maintain [by people] > But what if the next “person” isn’t a person? There's certainly a hypotheti
by HarHarVeryFunny 10mo ago
> <good> code is easier to understand to debug, extend, and maintain [by people]
> But what if the next “person” isn’t a person?
There's certainly a hypothetical future where AI writes and maintains enterprise software and airline baggage control systems consisting of millions of lines of spaghetti code, codes that violates all the principles of good software design that we currently value, and everything turns out peachy.
Nobody but the AI understands the code, but it mostly works, and the AI fixes it when it doesn't. We lose the capability to understand and test the code ourselves, but the AI says "trust me bro - it's all been tested" (even though bugs keep turning up).
But, I doubt it.
First off, nevermind all the "parroting" nonsense, but LLMs are nonetheless auto-regressively trained and therefore fundamentally a copying technology, so as long at the LLM creators make an effort to train on high quality code, then what's generated should at least match those high quality patterns to some degree.
Secondly, human's hard-won best-practices for designing code are there for a reason, and it's not just because of the limits of our feeble minds to work with anything-goes spaghetti code. The reason why we prefer code that is modular, with thin/clean interfaces between modules, shortish functions, etc, are because these practices fundamentally do make for code that is easier to reason about, to test and debug, to update and extend without breakage, etc.
Per the Halting Problem, we know that ultimately the only way to know what code does is to run it, and therefore even if LLMs/AI were to exceed humans in general reasoning ability they would never gain some magical abililty to write arbitrarily complex/unstructured code and be able to successfully reason about what it is doing and it's correctness, etc. Following human best practices not only helps create code that is testable (possible to analyze and create test cases for all paths through a piece of code), but also code that can more easily be reasoned about, whether by man or machine.
In terms of where we are right now regarding AI's ability to write good quality code, it's perhaps informative to look at Claude Code, which is of late writing most of it's own code under the guidance of it's creator, and despite being something on the very simple end of the spectrum in terms of software complexity*, currently has about 5,000 issues filed against it on github.
* A minimal CLI agent is a few hundred lines of code vs for example the 15 million LOC of gcc.