An example of LLM prompting for programming
I started a bit of an exploration around prompts and code a week or three back. I want to figure out the down&#x2F;up-sides and create tools for myself around it.<p>So, for this project (a game), I decided &quot;for fun&quot; to try to not write any code myself, and avoid narrow prompts that would just feed me single functions for a very specific purpose. The LLM should be responsible for this, not me! It&#x27;s pretty painful since I still have to debug and understand the potential garbage I was given and after understanding what is wrong, get rid of it, and change&#x2F;add to the prompt to get new code. Very often completely new code[1]. Rinse and repeat until I have what I need.<p>The above is a contrived scenario, but it does give some interesting insights. A nice one is that since here is one or more prompts connected to all the code (and its commit), the intention of the code is very well documented in natural language. The commit history creates a rather nice story that I would not normally get in a repository.<p>Another thing is, getting an LLM (ChatGPT mostly) to fix a bug is really hit and miss and mostly miss for me. Say, a buggy piece comes from the LLM and I feel that this could almost be what I need. I feed that back in with a hint or two and it&#x27;s very rare that it actually fixes something unless I am very very specific (again, needing to read&#x2F;understand the intention of the solution). In many cases I, again, get completely new code back. This, more than once, forced my hand to &quot;cheat&quot; and do human changes or additions.<p>Due to the nature of the contrived scenario, the code quality is obviously suffering but I am looking forward to making the LLM refactor&#x2F;clean things up eventually.<p>On occasion ChatGPT tells me it can&#x27;t help me with my homework. Which is interesting in itself. They are actually trying (but failing) to prevent that. I am really curious how gimped their models will be going forward.<p>I&#x27;ve been programming for quite long.  I&#x27;ve come to realize that I don&#x27;t need to be programming in the traditional sense. What I like is creating. If that means I can massage an LLM to do a bit of grunt work, I&#x27;m good with that.<p>That said, it still often feels very much like programming, though.<p>[1] The completely new code issue can likely be alleviated by tweaking transformers settings<p>Edit: For the curious, the repo is here: <a href="https:&#x2F;&#x2F;github.com&#x2F;romland&#x2F;llemmings">https:&#x2F;&#x2F;github.com&#x2F;romland&#x2F;llemmings</a> and an example of a commit from the other day: <a href="https:&#x2F;&#x2F;github.com&#x2F;romland&#x2F;llemmings&#x2F;commit&#x2F;466babf420f617dd0db1b2708b85203c83aab417">https:&#x2F;&#x2F;github.com&#x2F;romland&#x2F;llemmings&#x2F;commit&#x2F;466babf420f617dd...</a> - I will push through and make it a playable game, after that, I&#x27;ll see.