← contents

entry 05 · philosophy · 3 min · 10 oct 2026

Why does bad code bother us when it works?

A letter in a mailbox, a tray of gingerbread cookies, and Plato's idea that every refactor is a kind of remembering.

In college I read a book called Sophie’s World. Twelve years later I walked into a library, saw it on a shelf, and remembered everything at once.

It opens with a teenage girl finding a letter in her mailbox. No sender. Just two questions: “Who are you?” and “Where does the world come from?”

She can’t answer them. And she can’t stop thinking about them either.

I have a question like that. It showed up one day while I was staring at a perfectly working Rails controller, and it has been following me around ever since.

No failing test. No bug report. Nothing on fire. And still, something itches. This is the first of four notes where I follow that question through 2,400 years of philosophy, and it starts where Sophie started: with Plato.

The School of Athens. Raphael, 1511. Plato is in the middle, pointing up. The School of Athens. Raphael, 1511. Plato is in the middle, pointing up.

a tray of gingerbread cookies

Picture a tray of gingerbread cookies. At first glance they all look the same. Look closer and one has a dent, another lost a foot in the oven, one is a little burnt on the edge.

Now, if someone asked you what a gingerbread cookie is, you wouldn’t describe any of these. You’d describe the mold. The cookie you’ve never actually seen, but somehow know perfectly.

Plato called these Ideas: perfect forms behind everything we know. Every real thing is an imperfect copy, quietly striving toward its mold.

Plato's Cave. Jan Saenredam, 1604. We see the shadows on the wall. The Ideas are outside. Plato’s Cave. Jan Saenredam, 1604. We see the shadows on the wall. The Ideas are outside.

So here’s my question for you: what’s the mold for your code?

the itch has a name

You can’t see the mold. But you can feel it. That discomfort when you look at working code and something still bothers you? That’s the mold, casting a shadow on what you actually wrote.

Plato went further. He believed the soul had already seen every perfect form before it arrived in the body. So when we meet something beautiful in the real world, the soul stirs. It remembers. It yearns.

He called that yearning Eros.

Developers feel Eros all the time. Every time you refactor. Every time you stare at working code and feel the itch. Every time you start a new project and think this time, I’ll get it right.

That’s not perfectionism. That’s your soul trying to get back to the world of Ideas.

refactoring is remembering

Here’s some code from an imaginary library app. Read it slowly.

def process(account)
  account.loans.each do |loan|
    if loan.due_date < Date.today && !loan.returned?
      loan.update(overdue: true)
      AccountMailer.overdue_notice(account, loan).deliver_later
      account.increment!(:penalty_points)
    end
  end
end

It works. Tests pass. Now here’s the same behaviour, again:

def handle_overdue_books(account)
  account.loans.overdue.each do |loan|
    loan.mark_overdue!
    notify_member(account, loan)
    penalize(account)
  end
end

Nothing changed functionally. But one of them reads like a sentence: for each overdue book, mark it, notify the member, penalize the account. A librarian would recognise that policy immediately.

The first version has the exact same policy inside it. It’s just buried in a conditional, with no name and no shape. Waiting to be uncovered.

why does refactoring feel like uncovering something, rather than building something?

Plato already answered that.

a language that feels true

This is why bad code feels wrong even when it works. It isn’t a technical failure. It’s a failure to approximate the form you can already see clearly in your head.

And the Ruby community’s love for beautiful, expressive code? That’s not just taste. That’s Platonism.

It’s why Matz didn’t just want a language that worked. He wanted one that felt true.

But here’s the thing about true code: it’s never perfect. And that’s exactly where Plato’s own student starts to disagree with him. More on that in the next entry.