How to stop fighting with your AI pair programmer
skylarbpayne.com> Cursor is a nervous intern! They don’t want to admit they don’t know; we need to help by providing context.
With an intern, I give them some search terms and let them go learn. I don't have to do the searching for them. It's actually more important to help them learn how to evaluate the different results. It's not even that they "don't want to admit they don't know" (which is anthropomorphization), they are not designed or trained to ask clarifications. The chat based interaction is an "afterthought" (a round of fine tuning after initial training)
The big issues I see in this paradigm are
(1) you have to know a lot of things already to do this
(2) if we automate all the low hanging fruit, how will we develop humans to the level of understanding to do this
(3) with a human, I can delegate, with an AI, I have to handhold. As much as people want to call it "pair programming" it is often more like having to teach except in never truly learns, so I never get my lost time back
I think there's some updates I can make to this to give some guidance around the (1) you have to know a lot of things point. You can use AI assistance to help learn more. But ultimately, I don't believe we are at the point where the AI makes you "smarter"; but it _can_ make you more productive.
I disagree with (3) based on my experience. That feeling happens when I am not providing enough context. I rarely have experiences where I step back to provide more context and still end up in a dumb loop. Highly recommend providing lots of context + breaking down the problem more.
I would love to dig deeper into an example you have where you feel you "never get your time back". Because in general I am saving a lot of time from how much less typing I have to do.
I'd rather spend my time writing the code myself because it is enjoyable, then spend the same amount of time gathering context and verbosely explaining it in text to an AI
> Highly recommend providing lots of context + breaking down the problem more.
I don't have to do this with a human, I can delegate and know they will on their own. Also, the AI will make the same mistake if I come back a week later, a human learns online. This is at the core of lost time and I don't think AIs are close to this level without an advancement that takes us beyond transformers
Interesting! I find I very often have to do this with humans. But yes, the repeat mistakes is a thing. This is where ensuring I output context along the way is helpful. Although it's maybe annoying to "re-refer" to the context, I find that it helps the AI make the same mistakes less often
From tiny amount of experience I've had with LLM coding assistant, biggest problem was that it does not include what can be inferred but not explicitly asked, because(?) it's sort of a decompression process for a lossy copy of the Internet. You can't ask for a cheeseburger, but it has to be a hamburger with patty topped with sliced cheese and standard condiments.
Contrarily, it didn't seem to care a lot about roleplays other than for occasional compliments for reinforcements. If anything, old HN style blunt interactions seemed to help.
Interesting! Do you have an example with code? I am struggling to adapt the cheeseburger example to something with code.
The example is kind of opposite of the point GP's trying to make, isn't it? I mean, "cheeseburger" is a very well-known and a very specific thing. You ask a cook to make you one, they'll know what you want. Try asking for "a hamburger with patty topped with sliced cheese and standard condiments", and you'll probably get back a confused look, "er, you mean you want a cheeseburger, right?".
Same pattern happens with LLMs, in my experience. GP says an LLM infrerence is "sort of a decompression process for a lossy copy of the Internet" - but in these terms, if asking it for a cheeseburger means decompressing parts of the latent space around the term "cheeseburger", then asking for "a hamburger with patty topped with sliced cheese and standard condiments" is making it decompress much larger space around multiple terms, and then filter the result out into a semantically relevant subspace, and then run extra inference on that.
If you think about it, the very reason we (humans) give names to things is to avoid having to repeatedly do that decompression and filtering every time we want to refer to a specific thing. We call the modified "hamburger" a "cheeseburger" precisely to avoid having to talk like GP suggests we should talk to LLMs, so I very much think this advice is backwards.
Cursor kept giving me burgers without meat, without top, double wrapped, etc. I started giving it nested bullet points with amount of details roughly represent gut-felt relative volume of functions, and then the agent started macro-expanding the instructions much better. It did relocate, rename, and reorganize functions as needed. Then I could ask for fixes, manually trim extra bits, filled unmarked TODOs, to reach the desired end result.
It also seemed to do better with occasional stern instructions, like "ok but you're wrong, fix $item", than consistently teacher-student-like interactions like "Great! However, there is..." IME. I suppose students solutions are more likely to be wrong and/or less sophisticated.
The end product is on the Internet, nothing secret or inappropriate... I'm just reluctant to post "my first HTML" on HN.
"Add RBAC to my application"
Kind of like that, I had to word the input so that instruction looked like collapsed code and apparent correlation can be seen. It didn't do right from mere description of an end result.
The code was just an html file with some sticky buttons that would reset. AI left some stuffs set, left reset function empty, had handling codes scattered everywhere etc etc and just didn't get it. Being able to just keep rubberstamping AI until it breaks was a huge time saving, but it wasn't quite as much IQ saving.
With the example, "Add RBAC to my application", I’ve had success telling the LLM, “I want your help creating a plan to add RBAC to my application. I’m sending the codebase as context (or just the relevant parts if the entire codebase is too large). Please respond with a high-level, nontechnical outline of how we might do this.” Then take each step and recursively flesh it out until each step is thoroughly planned.
It’s wise to get the LLM to think more broadly and more collaboratively with questions like, “What question should I ask you that I haven’t yet” and similar
This gets at the point of of the original "cheeseburger" vs having to explain what a cheeseburger is to get a cheeseburger
> The fundamental issue is treating AI as a magic code generator rather than a collaborative team member.
The fundamental problem is the tools being marketed and onboarded that way. I don't blame them for getting frustrated.
You can't expect everyone to simply understand the limitations of LLMs and how the tool might be implemented. There is a user discovery issue at play here.
I noticed a lot of people complaining about Cursor agent being bad. And my initial experience was bad. After working with it for a while, I found a workflow that works for me; I hope it's helpful for you too!
Wow, i had no idea i could use cursor this way