Co-programming with GPT-4o: A Love Story Gone Recursive

Co-programming with GPT-4o: A Love Story Gone Recursive

Before we get started, let’s get one thing straight: this article breaks no new ground!

If you search Google, Bing, DuckDuckGo, or Perplexity for the phrase “Co-programming with GPT-4o,” you’ll find plenty of tales of woe about using GPT-4o as your pair programming partner.

So why did I do it?

Well, besides being a glutton for punishment, I asked GPT-4o,

“What is the best OpenAI model for co-programming?”

And it replied:

“[GPT-4o] 🔥 Overall best for co-programming.”

So there you have it! ChatGPT-4o told me it was the “Best of the best of the best…Sir!”

We Hit It Off Swell!

Everything started out great. I had an idea, and GPT-4o chatted me up. It told me how amazing my idea was and promised to help turn it into an app.

It provided me with a skeleton for the codebase and even gave me the exact statements I’d need to get started. We waxed philosophically about the merits of npm and yarn, and why it chose npm for this project.

When I mentioned that I wanted to use TypeScript instead of JavaScript, GPT-4o kindly converted the code and pointed out which type definitions I needed to install.

At this point, we were totally vibing.

I was poo-pooing everyone who had claimed GPT-4o couldn’t code.

YOU DOWN WITH GPT?

YEAH YOU KNOW ME.

Code? What Code?

A few days later, I came back to my prototype to make some frontend changes. GPT-4o walked me through the edits, asked if I wanted it to generate a new file, and I said yes.

I first suspected something was off when I noticed the new file was 50 lines shorter. When I ran the app, the styling was completely different.

I asked what went wrong. GPT-4o told me it had lost context. I offered to upload the current version, and it obliged — we were back on track.

There were a few more moments like this — context loss during refactoring, odd choices I wouldn’t have made — but I wrote them off as the cost of doing business.

I was still down with GPT.

But was GPT-4o still down with me?

The Ides of March or Et tu GPT-4o

The final blow came when I was refactoring some logging logic. My good friend GPT-4o suggested we DRY up the code. I was like:

“OK, GPT-4o, I see you modularizing my code and making reusable components!”

It took this:

const logDir = process.env.LOG_PATH || path.join(__dirname, '../../logs');
const logPath = path.join(logDir, 'conversations.jsonl');

And converted them into the function:

function getLogFilePath(): string {
  let logDir = process.env.LOG_DIR || getLogFileDir(); // 🚨 infinite recursion!
  let logPath = Path2D.join(logDir, 'conversations.jsonl');
  return logPath;
}

Yep, you read that right: Path2D.join(...).

I don’t know if that was hallucination or performance art, but either way, it wasn’t helpful. (And yes, I think it meant path.join(...).)

When I pointed out the infinite recursion, GPT-4o thanked me and recommended a fix.

Still, I figured it was time to get to a stopping point and try a different model.

So I asked GPT-4o to complete one last task: finish DRYing up a few more parts of the code.

I uploaded the current file. Asked for a clean rewrite. GPT-4o gave me broken output.

I tried again. And again. And again.

Five uploads later, I finally figured out the issue: a newline character was being mishandled during patching.

When I flagged it, GPT-4o jumped in and said:

You’re spot on — the newline string is easy to break in patching logic because:

  • ‘\n’ (Python-escaped newline) looks correct in code but often renders as ‘n’ or literal text if mishandled
  • This is a common gotcha in regex-based manipulation when we don’t parse the code structure semantically

I appreciated the honesty. But I also wanted working code.

Conclusion

There are things GPT-4o does really well. And to be fair, the model has already improved since this experiment. It was helpful with scaffolding, converting JavaScript to TypeScript, and even philosophical debates about dependency managers.

But co-programming isn’t just about vibes. It’s about trust, context, and precision — especially when you’re iterating on real-world code.

If you decide to vibe-code with GPT-4o, make sure you’ve got version control, a good debugger, and a willingness to triple-check newline characters.

As for whether GPT-4o is still “🔥 Overall best for co-programming”?

Let’s just say… it’s still under review.