Live data from Hacker News

AI coding and the peanut butter and jelly problem

iamcharliegraham.substack.com

31–40 of 83 posts

Re: AI coding and the peanut butter and jelly problem

#31
"I bought those expensive knives. Why doesn't my cooking taste better?"

"I picked up an extraordinary violin once. It sounded awful!"

There's an art here. Managerial genius is recognizing everyone's strengths and weaknesses, and maximizing impact. Coding with AI is no different.

Of course I have to understand the code well enough to have written it. Usually much of the time is spent proposing improvements.

I'm a few months in, learning to code with AI for my math research. After a career as a professor, I'm not sure I could explain to anyone what I'm starting to get right, but I'm working several times more efficiently than I ever could by hand.

Some people will get the hang of this faster than others, and it's bull to think this can be taught.

Re: AI coding and the peanut butter and jelly problem

#32
post #27
post #14

Earlier quoted context omitted.

>This statement assumes years of grueling training to become bilingual in a foreign programming language ...So, less experienced programmers are supposed to be happy that they can save time with the same technology that will convince their employers that a human isn't necessary for the position? (And, frankly, I've overall quite enjoyed the many years I've put into the craft.)

You're seeing this entirely from the perspective of people who do programming as their job. I'm seeing it from the perspective of the other 99% of society. It feels really good that they're no longer gatekept by the rigid and cryptic interfaces that prevented them from really communicating with their computer, just because it couldn't speak their native tongue.

The point of the PB&J thing is exactly to demonstrate that your native tongue isn’t precise enough to program a computer with. There’s a reason those interfaces are rigid, and it’s not “gatekeeping”. (The cryptic part is just to increase information density — see COBOL for an alternative.)

Re: AI coding and the peanut butter and jelly problem

#34
post #32
post #27

Earlier quoted context omitted.

You're seeing this entirely from the perspective of people who do programming as their job. I'm seeing it from the perspective of the other 99% of society. It feels really good that they're no longer gatekept by the rigid and cryptic interfaces that prevented them from really communicating with their computer, just because it couldn't speak their native tongue.

The point of the PB&J thing is exactly to demonstrate that your native tongue isn’t precise enough to program a computer with. There’s a reason those interfaces are rigid, and it’s not “gatekeeping”. (The cryptic part is just to increase information density — see COBOL for an alternative.)

I think https://docs.cursor.com/chat/agent has shown plain English is precise enough to program a computer with, and some well respected programmers have become fans of it https://x.com/karpathy/status/1886192184808149383

I only took exception to the original statement - that coding is trivial, and the questioning if AI is even useful. So many people are finally able to create things they were never able to. That's something to celebrate. Coding isn't trivial to most people, it's more of an insurmountable barrier to entry. English works - that's why a clear-minded project manager can delegate programming to someone fluent in it, without knowing how to code themselves. We don't end up with them dumping a jar of jam on the floor, because intelligent beings can communicate in the context of a lot of prior knowledge they were trained on. That's how AI is overcoming the peanut butter and jelly problem of English. It doesn't need solutions defined for it, a word to the wise is sufficient.

Re: AI coding and the peanut butter and jelly problem

#36
post #27
post #14

Earlier quoted context omitted.

>This statement assumes years of grueling training to become bilingual in a foreign programming language ...So, less experienced programmers are supposed to be happy that they can save time with the same technology that will convince their employers that a human isn't necessary for the position? (And, frankly, I've overall quite enjoyed the many years I've put into the craft.)

You're seeing this entirely from the perspective of people who do programming as their job. I'm seeing it from the perspective of the other 99% of society. It feels really good that they're no longer gatekept by the rigid and cryptic interfaces that prevented them from really communicating with their computer, just because it couldn't speak their native tongue.

[deleted]

Re: AI coding and the peanut butter and jelly problem

#37
lol, I didn't realize how famous the PB&J exercise was. That's fantastic. I thought it was just from this puppet video I've been showing my 4yo and his friends. Anyway they seem to love it.

https://m.youtube.com/watch?v=RmbFJq2jADY&t=3m25s

Also seems like great advice, feels like a good description of what Ive been gravitating towards / having more luck with lately proompting.

Re: AI coding and the peanut butter and jelly problem

#38
> Today’s AI Still Has a PB&J Problem

If this is how you're modelling the problem, then I don't think you learned the right lesson from the PB&J "parable."

Here's a timeless bit of wisdom, several decades old at this point:

Managers think that if you can just replace code with something else that isn't text with formal syntax, then all the sudden "regular people" (like them, maybe?) will be able to "program" a system. But it never works. And the reason it never works is fundamental to how humans relate to computers.

Hucksters continually reinvent the concept of "business rules engines" to sell to naive CTOs. As a manager, you might think it's a great idea to encode logic/constraints into some kind of database — maybe one you even "program" visually like UML or something! — and to then have some tool run through and interpret those. You can update business rules "live and on the fly", without calling a programmer!

They think it's a great idea... until the first time they try to actually use such a system in anger to encode a real business process. Then they hit the PB&J problem. And, in the end, they must get programmers to interface with the business rules engine for them.

What's going on there? What's missing in the interaction between a manager and a business rules engine, that gets fixed by inserting a programmer?

There are actually two things:

1. Mechanical sympathy. The programmer knows the solution domain — and so the programmer can act as an advocate for the solution domain (in the same way that a compiler does, but much more human-friendly and long-sighted/predictive/10k-ft-view-architectural). The programmer knows enough about the machine and about how programs should be built to know what just won't work — and so will push back on a half-assed design, rather than carrying the manager through on a shared delusion that what they're trying to do is going to work out.

2. Iterative formalization. The programmer knows what information is needed by a versatile union/superset of possible solution architectures in the solution space — not only to design a particular solution, but also to "work backward", comparing/contrasting which solution architectures might be a better fit given the design's parameters. And when the manager hasn't provided this information — the programmer knows to ask questions.

Asking the right questions to get the information needed to determine the right architecture and design a solution — that's called requirements analysis.

And no matter what fancy automatic "do what I mean" system you put in place between a manager and a machine — no matter how "smart" it might be — if it isn't playing the role of a programmer, both in guiding the manager through the requirements analysis process, and in pushing back through knowledge of mechanical sympathy... then you get PB&J.

That being said: LLMs aren't fundamentally incapable of "doing what programmers do", I don't think. The current generation of LLMs is just seemingly

1. highly sycophantic and constitutionally scared of speaking as an authority / pushing back / telling the user they're wrong; and

2. trained to always try to solve the problem as stated, rather than asking questions "until satisfied."

Re: AI coding and the peanut butter and jelly problem

#39
post #30
post #6

Okay, but like. If you do have that skill to communicate clearly and describe the requirements of a novel problem, why is the AI still useful? Actually writing the code should be relatively trivial from there. If it isn't, that points to a problem with your tools/architecture/etc. Programmers IMX are, on average, far too tolerant of boilerplate.

Exactly. This same point was mentioned on Accidental Tech Podcast last week during a section primarily about “vibe coding”. (May have been the paid-only segment) If the LLM gets something wrong, you have to be more exact to get it to make the program do the thing you want. And when that isn’t perfect, you have to tell it exactly what you want to to do in THAT situation. And the next one. And the next one. At that poi…

This is what I keep coming back to. I'm sure I'm not the only one here who frequently writes the code, or at least a PoC, then writes the design doc based on it. Because the code is the most concise and precise way to specify what you really want. And writing it gives you more clarity on things you might not have thought about when writing it in a document. Unrolling that into pseudocode/English almost always gets convoluted for anything but very linear pieces of logic, and you're generally not going to get it right if you haven't already done a little exploratory coding beforehand.

So to me, even in an ideal world the dream of AI coding is backwards. It's more verbose, it's harder to conceptualize, it's less precise, and it's going to be more of a pain to get right even if it worked perfectly.

That's not to say it'll never work. But the interface has to change a lot. Instead of a UX where you have to think about and specify all the details up front, a useful assistant would be more conversational, analyze the existing codebase, clarify the change you're asking about, propose some options, ask which layer of the system, which design patterns to use, whether the level of coupling makes sense, what extensions of the functionality you're thinking about in the future, pros and cons of each approach, and also help point out conflicts or vague requirements, etc. But it seems like we've got quite a way to go before we get there.

Post reply on HN