New year, new blog post: I had a random question, what happens when LLMs are prompted to write better code, again and again? Do they actually write better code? The answer is yes*! https://minimaxir.com/2025/01/write-better-code/
=> More informations about this toot | More toots from minimaxir@sigmoid.social
@minimaxir Have you tried it on something which isn't a well-trodden algorithmic problem that's likely to be well-represented in its corpus?
I just did a quick experiment of trying to improve some code I'm working with as part of a code archeology project. The codebase is Java & OpenGL.
The first "improve this code" made a small improvement (transforming an ArrayList into a Map for faster lookup), but missed the removal of an unnecessary domain type. 1/
=> More informations about this toot | More toots from kittylyst@mastodon.social
@minimaxir @simon The second iteration still didn't fix the unnecessary domain type, introduced 3 separate bugs and also provided an incorrect explanation, that falsely claimed that the approach it picked to thread-safety was equivalent to the other, correct approach. So, YMMV I guess. /2
=> More informations about this toot | More toots from kittylyst@mastodon.social
@kittylyst @minimaxir that was my interpretation of the article: saying "do better" doesn't necessarily produce better or bug free code, but it can still highlight interesting potential areas for a human programmer to dig into and collaborate with the LLM to get working (like numba JIT)
=> More informations about this toot | More toots from simon@simonwillison.net
text/gemini
This content has been proxied by September (3851b).