How I work

What I believe about building software.

These are opinions I picked up on real projects, plus a few from books that put words to things I had already run into. Every one of them came from something that broke.

Architecture decides which changes are cheap

People talk about architecture like it's diagrams. To me it's simpler: it's the set of decisions that make some future changes easy and others painful. Every codebase has one. The only question is whether somebody chose it.

When I design something, I try to guess where change will come from. Which API will be replaced? Which feature will double in size? Where will a second team show up? Good architecture means there's a seam ready when that change arrives. Bad architecture means every change touches everything.

This is why I care so much about boundaries: modules, protocols, an SDK's public API. John Ousterhout describes the best modules in A Philosophy of Software Design as deep: a simple interface hiding a lot of work. On BankID, five banks used about ten public methods while sixteen-plus flows lived behind them. That's what let us change the inside without asking anyone's permission.

A good boundary tells the rest of the system what it doesn't need to know.

Users feel performance even when they can't name it

Nobody files a bug saying "the main thread was blocked for 400 milliseconds." They say the app feels heavy. Then they stop saying anything, because they've left.

On HeyWeather I found 4 hangs and more than a dozen micro-hangs. None of them looked serious alone. Together they were the difference between an app that felt smooth and one that felt stuck. So I treat speed and memory as things to measure, not things to hope for, and I measure on real devices, especially old ones.

On a phone, your app shares a battery, a temperature limit and a memory ceiling with everything else the person carries around. Wasting those is wasting something that belongs to the user.

Simple is harder than clever

Complexity works like a loan. You take it to ship something sooner, and everyone who touches the code later pays the interest: slower onboarding, bugs hiding between features, a one-week task that takes a month. In my experience, struggling codebases are rarely full of bad code. They're full of small clever ideas that piled up.

So my default is plain code. Value types over complicated object graphs. One obvious way to do something instead of three flexible ones. A new framework has to earn its place. If a new engineer can't explain how data moves through a feature after a week, I treat that as a design problem, not their problem.

The hard part is that simple takes longer to design. It means saying no to abstractions that would be fun to build and deleting code that was hard to write. The Pragmatic Programmer has a line about not living with broken windows. I'd add: don't live with clever ones either.

Write for the next engineer

Code has two readers: the compiler, once, and your colleagues, for years. Robert C. Martin makes this point in Clean Code, and it took me a few years of maintaining other people's apps to really believe it.

I picture a specific person: competent, tired, under a deadline, with none of my context, opening this file a year and a half from now. They need names that say what things are, data that moves in one direction, errors that say whose fault they are, and a short note explaining what we decided and what we rejected. All of that is cheap to write on the day and very expensive to rebuild later.

Usually that next engineer is me. Many of my habits started as apologies to a past version of myself who lost a weekend figuring out his own code.

Change big systems in small steps

I almost never rewrite. At Coinlocally we moved from Objective-C to Swift screen by screen while the exchange kept trading. At Saraf a 226-file legacy tree kept compiling next to 25 new modules until each flow was moved over. Martin Fowler calls this the strangler fig pattern, and his book Refactoring is the best guide I know to doing it safely: small steps, behavior kept the same, tests as the safety net.

Michael Feathers says in Working Effectively with Legacy Code that legacy code is simply code without tests. So the first step in a migration isn't new architecture. It's finding seams where tests can go in.

And I treat deleting code as real progress. Code you removed can't break, can't be exploited, and can't confuse anyone at two in the morning.

Be a professional about it

The Clean Coder is less about code than about how to behave as someone people depend on. Two ideas from it stuck with me. First, say no when no is the true answer, and say it early. When Hamrah Card lost its Apple Developer account, "here's a fallback and a realistic timeline" was more useful than any promise. Second, estimates are not commitments. I give ranges, I say what they depend on, and I update them when something changes.

It also means owning your mistakes. Several case studies on this site include my own bugs. I think they're the most useful parts.

Mentoring is part of the architecture

The systems I'm proudest of are the ones that kept improving after I stopped touching them. That only happens when the people around the code understand why it's shaped the way it is.

So in code reviews I try to explain the reason, not only the fix. In design discussions I think out loud so less experienced engineers can follow the reasoning. On WARP I learned that directing someone else's work is easier when the right way is also the easiest way in the code: one enum for endpoints, one pattern for repositories. Then the work stays consistent even when I'm not in the room.

“I judge senior engineers, including myself, by one thing: how many problems stop being hard for the people around them.”
See how this played out in real projects