Vibe Coding: Programming by Coincidence

You may or may not have wondered why there were suddenly no emails for the last two weeks. It turns out that writing a daily email isn't quite feasible when you're down with pneumonia. Now that I'm a week into taking antibiotics, things are looking better.

So, anyway. Right now, it seems like everyone is talking about Vibe Coding:

  • Just ask the AI coding agent for what you want.

  • If the program spits out errors, feed those back to the agent.

  • Accept all changes suggested by the AI.

  • Rinse and repeat until it sort of works.

Programming by Coincidence

I couldn't help but remember a chapter from one of my favourite books, The Pragmatic Programmer, about Programming by Coincidence.

Quoting the intro paragraphs:

Suppose Fred is given a programming assignment. Fred types in some code, tries it, and it seems to work. Fred types in some more code, tries it, and it still seems to work. After several weeks of coding this way, the program suddenly stops working, and after hours of trying to fix it, he still doesn’t know why. Fred may well spend a significant amount of time chasing this piece of code around without ever being able to fix it. No matter what he does, it just doesn’t ever seem to work right.

Fred doesn’t know why the code is failing because he didn’t know why it worked in the first place. It seemed to work, given the limited “testing’’ that Fred did, but that was just a coincidence. Buoyed by false confidence, Fred charged ahead into oblivion. Now, most intelligent people may know someone like Fred, but we know better. We don’t rely on coincidences—do we?

What's true for manual coding is doubly true for AI-assisted coding. If you never understood why something worked, you're stuck the moment it goes awry.

It's okay to vibe code on some one-off personal-use tool, but certainly not for a moving target like a client-facing web app. Who cares if the AI gets you, say, 50% or 60% or even 80% there if the resulting code is of such low quality that finishing the remaining 20% is near impossible?

Previous
Previous

AI vs VAs

Next
Next

Wide and Narrow Thinking