Earlier quoted context omitted.
At that point isn't it starting to become easier to just write the code yourself? If I somehow have to formulate how I want a problem solved, then I've already done all the hard work myself. Having the LLM just do the typing of the code means that now not only did I have to solve the problem, I also get to do a code review.
There's no clear threshold with an universal answer. Sometimes prompting will be easier, sometimes writing things yourself. You'll have to add some debugging time to both sides in practice. Also, you can be opportunistic - you're going to write a commit anyway, right? A good commit message will be close to the prompt anyway, so why not start with that and see if you want to write your own or not? > I also get to do a…
Can LLMs write better code if you keep asking them to “write better code”?
61–70 of 461 posts
Re: Can LLMs write better code if you keep asking them to “write better code”?
#62has anyone tried saying "this will look good on your promo package"?
- You're doing better...
- Thanks that helps me...
And I just wonder if that actually has an improvement...
Re: Can LLMs write better code if you keep asking them to “write better code”?
#63Something major missing from the LLM toolkit at the moment is that it can't actually run (and e.g. test or benchmark) its own code. Without that, the LLM is flying blind. I guess there are big security risks involved in making this happen. I wonder if anyone has figured out what kind of sandbox could safely be handed to a LLM.
Re: Can LLMs write better code if you keep asking them to “write better code”?
#64Earlier quoted context omitted.
It'd be great if it could describe the performance of code in detail, but for now just adding a skill to detect if a bit of code has any infinite loops would be a quick and easy hack to be going on with.
Is reliably detecting if code has any infinite loops feasible? Sounds like the halting problem.
I think that's the joke. In a sci-fi story, that would make the computer explode.
Re: Can LLMs write better code if you keep asking them to “write better code”?
#65I often run into LLMs writing "beginner code" that uses the most fundamental findings in really impractical ways. Trained on too many tutorials I assume. Usually, specifying the packages to use and asking for something less convoluted works really well. Problem is, how would you know if you have never learned to code without an LLM?
ChatGPT has, for several generations, generally made stuff that works, but the libraries it gives me are often not the most appropriate, and are sometimes obsolete or no longer functional — and precisely because web and python are hobbies for me rather than my day job, it can take me a while to spot such mistakes.
Two other things I've noticed, related in an unfortunate way:
1) Because web and python not my day job, more often than not and with increasing frequency, I ultimately discover that when I disagree with ChatGPT, the AI was right and I was wrong.
2) These specific models often struggle when my response has been "don't use $thing or $approach"; unfortunately this seems to be equally applicable regardless of if the AI knew more than me or not, so it's not got predictive power for me.
(I also use custom instruction, you YMMV)
Re: Can LLMs write better code if you keep asking them to “write better code”?
#66Well, that's a big assumption. Some people quality modular code is some other too much indirect code.
Re: Can LLMs write better code if you keep asking them to “write better code”?
#67I often run into LLMs writing "beginner code" that uses the most fundamental findings in really impractical ways. Trained on too many tutorials I assume. Usually, specifying the packages to use and asking for something less convoluted works really well. Problem is, how would you know if you have never learned to code without an LLM?
Maybe because of experience: it's much simpler and easier to turn that into "senior code". After a few decades of experience I appreciate simplicity over the over-engineering mess that some mid-level developers tend to produce.
Re: Can LLMs write better code if you keep asking them to “write better code”?
#68its best to tell them how you want the code written.
At that point isn't it starting to become easier to just write the code yourself? If I somehow have to formulate how I want a problem solved, then I've already done all the hard work myself. Having the LLM just do the typing of the code means that now not only did I have to solve the problem, I also get to do a code review.
This reduction in cognitive load is the real force multiplier.
Re: Can LLMs write better code if you keep asking them to “write better code”?
#69My takeaway and also personal experience is that you get the best results is that you co-develop with the LLM. - write a simple prompt that explains in detail the wanted outcome. - look at the result, run it and ask it how it can improve. - tell it what to improve - tell it to make a benchmark and unit test - run it each time and see what is wrong or can be improved.
Also: If you're experienced at code reviews, you can get great results.
Re: Can LLMs write better code if you keep asking them to “write better code”?
#70Something major missing from the LLM toolkit at the moment is that it can't actually run (and e.g. test or benchmark) its own code. Without that, the LLM is flying blind. I guess there are big security risks involved in making this happen. I wonder if anyone has figured out what kind of sandbox could safely be handed to a LLM.
You can find more details about this experiment in a blog post: https://mixedbit.org/blog/2024/12/16/improving_unit_test_cov...