has anyone found a good way to improve code quality? just wondering -- LOC does seem like the wrong metric, but the code LLMs write is just too verbose
has anyone found a good way to improve code quality? just wondering ...
- keep prompts focused on atomic tasks.
- use expert prompting[0] when possible.
- require coding agents to verify changes.
- require coding agents to create/update unit tests with 100% coverage.
- use git to commit/revert atomic tasks manually.
- leverage planning capabilities to review instead of recover.
- consider using something like Karpathy guidelines[1].
- leverage Constraint Programming[2] concepts when
formulating prompts.
So far, the best way I’ve found to improve code quality from LLMs that you’ve already produced is to read the output, throw it away, and hand-write it from scratch, usually with a totally different structure.
This scales about as well as it sounds like it would.
Multi-model review does a decent job identifying things they’re outright wrong. The resulting code still doesn’t feel elegant writ large.
If you want good output, it seems that iterating on the output is inferior to providing better input inclusive of code examples. And by the time you’ve made all the decisions that go into that, something like ponytail is superfluous.
(All that said, I have ponytail installed in most harnesses.)
I'm working on a LLM code review tool that focuses on reducing concepts instead of reducing lines. I think that's more along the lines of explaining what you want out of clean code than ponytail's approach. But I'm still playing with it so, not sure. And just because it produces code I like doesn't mean it's good code for everyone
Comments
has anyone found a good way to improve code quality? just wondering -- LOC does seem like the wrong metric, but the code LLMs write is just too verbose
1 - https://github.com/multica-ai/andrej-karpathy-skills
2 - https://en.wikipedia.org/wiki/Constraint_programming
So far, the best way I’ve found to improve code quality from LLMs that you’ve already produced is to read the output, throw it away, and hand-write it from scratch, usually with a totally different structure.
This scales about as well as it sounds like it would.
Multi-model review does a decent job identifying things they’re outright wrong. The resulting code still doesn’t feel elegant writ large.
If you want good output, it seems that iterating on the output is inferior to providing better input inclusive of code examples. And by the time you’ve made all the decisions that go into that, something like ponytail is superfluous.
(All that said, I have ponytail installed in most harnesses.)
I'm working on a LLM code review tool that focuses on reducing concepts instead of reducing lines. I think that's more along the lines of explaining what you want out of clean code than ponytail's approach. But I'm still playing with it so, not sure. And just because it produces code I like doesn't mean it's good code for everyone