Code quality is actually much more important for AIs than it is for humans. With humans you can say, oh that function is just weird, here’s how it works, and they’ll remember. With AIs (at present, with current memory capabilities), they have to rederive the spec of the codebase every time from scratch. It’s like you’re onboarding a new junior engineer every day.
Sort of. But you can also ask LLMs to put in a lot of effort understanding the codebase, run tests to disprove its hypotheses, and write documentation or refactor.
One interesting anecdote is how LLMs found a bunch of vulnerabilities in OpenSSL, and OpenSSL is notable for having a particularly bad/hard to work with codebase, suggesting that humans couldn’t find them because it was too hard to read. While higher code quality alternatives had none of the same vulnerabilities.
You could just add excessive comments (and in fact that’s what many LLMs tend to do) to functions, which are annoying to read for humans but less so for LLMs.
But I don’t think you should, because your ability to understand code that you didn’t write yourself quickly becomes a bottleneck
Code quality is actually much more important for AIs than it is for humans. With humans you can say, oh that function is just weird, here’s how it works, and they’ll remember. With AIs (at present, with current memory capabilities), they have to rederive the spec of the codebase every time from scratch. It’s like you’re onboarding a new junior engineer every day.
Sort of. But you can also ask LLMs to put in a lot of effort understanding the codebase, run tests to disprove its hypotheses, and write documentation or refactor.
One interesting anecdote is how LLMs found a bunch of vulnerabilities in OpenSSL, and OpenSSL is notable for having a particularly bad/hard to work with codebase, suggesting that humans couldn’t find them because it was too hard to read. While higher code quality alternatives had none of the same vulnerabilities.
You could just add excessive comments (and in fact that’s what many LLMs tend to do) to functions, which are annoying to read for humans but less so for LLMs.
But I don’t think you should, because your ability to understand code that you didn’t write yourself quickly becomes a bottleneck