Skip to content
Products that last cover
writing

Boring code is a feature you ship to your future self

The durable choice in code usually looks unimpressive, and that is the point. Why boring code wins on systems that have to last, how to defend the plain version in review, and the discipline of deleting clever code you were proud of.

Hasan MisbahHasan Misbah8 min read
code-quality
maintainability
code-review
products-that-last
TL;DR

The durable choice in code usually looks unimpressive by design. Boring code optimizes for the incident and the handoff, so defend the plain version from the failure mode, not taste, and delete clever code when a simpler version exists.

The durable choice in code almost always looks unimpressive, and that is the feature, not a compromise. Boring code (the obvious control flow, the explicit conditional, the named variable instead of the clever chain) is something you ship to the person who has to debug it at 2am, ideally warned by monitoring that runs at the edge before users are, and that person is usually you. Cleverness feels like value while you write it. It reveals its true cost six months later, when someone reads it under pressure and cannot tell what it does.

I build revenue-critical systems: licensing, subscriptions, payments, where the boring choices, like storing money as integer cents rather than a float, are the ones that keep the numbers honest. In that world an outage is not a slow page, it is customers who cannot pay or cannot use what they paid for. That raises the stakes on readability in a way that reframes the whole “elegant vs boring” argument. When the failure mode is money and trust, the most valuable property of code is that a tired human can understand it correctly on the first read.

Why boring wins

Boring code optimizes for the moment that actually matters: the incident, the handoff, the change you make a year after you forgot how it worked. Clever code optimizes for the moment that does not matter much: the fifteen minutes you spent writing it feeling smart.

Concretely, boring means:

  • One obvious path through a function, not three clever branches folded into a ternary.
  • Explicit names for the states of a thing, not booleans you have to decode.
  • Doing the dumb reliable thing (a database unique constraint) instead of the smart fragile thing (a clever in-memory dedupe).
  • Code that a competent stranger can change without archaeology.

Here is the shape of it. Same logic, two temperaments:

// Clever. Reads like a puzzle, breaks like one.
return $sub->trial_ends_at?->isFuture()
    ?? ($sub->canceled_at ? false : $sub->paid);

// Boring. Reads like a sentence.
if ($sub->onTrial()) {
    return true;
}
if ($sub->isCanceled()) {
    return false;
}
return $sub->isPaid();

The second is longer and I will take it every time. When a customer disputes their access at 11pm, I want to read three plain sentences, not reverse engineer a null coalescing operator I was proud of in April.

The cost clever code hides

Clever code moves cost in time, the same way skipping idempotency does. It feels free now because the author holds all the context. The context evaporates. What is left is a line that works but nobody wants to touch, so people build around it instead of through it, and the workaround becomes the next person’s clever code. That is how a codebase calcifies: not from bad engineers, but from a hundred small acts of cleverness nobody could safely delete.

The durable version costs a few more keystrokes now and almost nothing later. That trade is the whole game in software that has to last.

Defending boring in code review

The hard part is social, not technical. Boring code gets challenged in review by well-meaning people who mistake terseness for quality. You need a way to defend the plain option that does not sound like you are just less skilled.

What works for me is to argue from the reader, not the writer:

  • “This is fewer lines, but count the concepts someone has to hold to be sure it is correct. The longer version has fewer.”
  • “Show me how you would change this under a deadline. If the answer involves rereading it three times, that is the cost.”
  • “What does this do when the input is null? If we both have to stop and think, the next person will get it wrong.”

Notice none of that is about taste. It is about the failure mode. Taste arguments are unwinnable. Failure-mode arguments end with someone saying “fair” and merging the boring version.

Deleting clever code you were proud of

The discipline nobody talks about is deletion. Sometimes the clever code is yours, it works, and you are attached to it. Delete it anyway when a plainer version exists. Sunk cost is not a code quality metric. I have replaced my own compact one liners with five boring lines more than once, usually right after watching a teammate misread the compact version in a pull request. If a smart colleague misreads it, it is not clever, it is a trap with good production values.

A useful test before you keep something clever: could you delete it right now without hesitation if a simpler version existed. If the honest answer is “no, I like it”, that attachment is the problem, not a reason to keep it.

Saying no is part of the job

Boring is also a stance you take against your own tools and habits. No to the new abstraction that saves four lines and adds a concept. No to the dependency that does one thing you could write in ten lines you understand. No to the premature generalization for the second case that does not exist yet. Every no keeps the surface area small, and small surface area is what lets a system survive its authors leaving.

This is not an argument for crude code or for never using a good abstraction. A well-chosen abstraction is boring in the best way: it hides complexity behind an obvious name. The line I hold is that the abstraction has to pay for the concept it adds. Most clever code does not pass that test. It adds a concept to save some characters, and characters are free while concepts are expensive.

What you are actually shipping

When you choose the boring version, you are shipping something to a future person: a faster incident, a cleaner handoff, a change that takes an hour instead of a day. That person cannot thank you, but you can be that person, and you will be, on some night when a customer cannot check out and the fix has to be right the first time.

The engineers I trust with revenue-critical code are not the ones who write the most impressive line. They are the ones whose code I can read while half asleep and change without fear, and it is the same lens I bring when I read an unfamiliar codebase for the first time. That is the highest compliment I give code, and it is why I spend my review capital defending the plain version and my own time deleting the clever one. Boring is not the absence of skill. On systems that have to last, it is the skill.

The takeaway

Boring code is a gift you ship to whoever debugs the system next, and on software that has to last, that person is usually you. Argue for the plain version from the failure mode rather than taste, spend your review capital defending it, and delete the clever line you were proud of when a simpler one exists. That discipline is not the absence of skill; on systems where the failure mode is money and trust, it is the skill.

FAQ

Isn’t boring code just an excuse for writing less skilled code?

No. A well-chosen abstraction is boring in the best way, hiding complexity behind an obvious name. The discipline is making every abstraction pay for the concept it adds, which most clever code fails to do.

How do I defend the plain version when a reviewer calls it verbose?

Argue from the reader, not the writer. Count the concepts someone must hold to be sure it is correct, and ask how they would change it under a deadline. Failure-mode arguments end in agreement where taste arguments do not.

When is clever code actually worth keeping?

When you could delete it without hesitation if a simpler version existed and still choose it on the merits. If your honest answer is “no, I like it”, the attachment is the problem, not a reason to keep it.

Why does this matter more for billing and payments than other code?

Because the failure mode is money and trust, not a slow page. When a customer cannot check out at 11pm, you want to read three plain sentences, not reverse engineer a null coalescing operator.

Does boring mean I should never add a dependency or abstraction?

No, it means the abstraction has to earn the concept it introduces. Say no to the one that saves four lines and adds a concept, and yes to the one that hides real complexity behind an obvious name.

let's talk

Building something where this kind of work matters?

I'm in GMT+6 and work async-first, so your timezone is never a reason not to reach out.

Get in touch
Copyright © Hasan Misbah. All rights reserved.
Hasan Misbah