Outside the Walled Garden
Every company that builds software is, hopefully, shipping the things that matter. Features, bug fixes, improvements, usually decided by what customers are asking for and what stakeholders need. By the time an engineer picks any of it up, somebody has already agreed that it's important.
That's the job, the business of shipping software, and it's what fills most of my days. There's a clear line between the work and the value it adds, which is a big part of what makes it satisfying.
Every now and then, though, I stumble on an odd inefficiency that would never have shown up in a ticket and isn't obvious from the code in front of me. Often it's hiding beneath the surface, in a library or package I depend on, or in a corner of the codebase I rarely visit. None of it is broken. There's no user complaint and no failing tests but it nerd snipes me, and all I can think about is how much I could improve its performance.
Occasionally it turns into an absolute treasure trove. One oddity leads to another, and before long I've got a list of things I want to improve that have gone quietly unnoticed.
What makes these finds so satisfying is that, on their own, none of them look like much. A file a bit bigger than it needs to be, a few milliseconds on a request, a query that didn't need to run. It's easy to see why nobody flagged them. They're tucked away somewhere nobody looks, and individually they really don't matter.
It’s when I start asking how often that code runs that it gets exciting. An export that’s a little too slow and twice the size it needs to be is nothing if it’s only generated once. Run it thousands of times a day and keep the results for months, though, and the company is paying for wasted compute and double the storage it needs, all from one small corner of the system. That’s usually the moment the nerd snipe properly takes hold.
Does it actually matter?
It would be very easy to take this too far. Almost any piece of software can be made to perform better with enough time (and tokens!), but chasing a smaller number for its own sake isn't the best use of time and effort.
So the question I try to ask before I change anything isn't "can this perform better?" but "does this matter, and to whom?"
The first half is usually the easy part, the harder part is working out who the saving actually lands with. Halving that export might take a real chunk off the storage bill and the transfer fees, which matters to whoever pays for the infrastructure. It might make downloads noticeably quicker for the people using it. Or, if the file is only ever generated overnight and read by one internal job, the honest answer might be nobody.
Those answers need to be good ones, because the change itself isn't free. If the honest answer to both questions is just "me", because it bugs me and I'd enjoy fixing it, then a thousand-line diff isn't worth the blast radius. A clever compression step that halves the export might look great in the numbers, but someone else has to review it, maintain it, and work out what it does when it breaks in six months. That's only worth it if the saving lands with someone other than me.
Sometimes the right outcome is leaving it alone. That still counts, because I've swapped "this looks a bit weird" for a real understanding of the trade-off.
This isn't always technical debt
Being able to leave it alone says something about these finds. Nobody was asking me to fix them in the first place, and that's what separates them from technical debt, which is usually where people expect this kind of work to live.
Technical debt tends to announce itself. A shortcut from six months ago makes every new feature painful, or there's a class nobody wants to touch because every change breaks something else. People start padding their estimates for it and bringing it up in retros, until eventually someone has to deal with it.
The things I've been describing don't announce themselves like that. An oversized export never slowed anyone down or caused an incident, and there was no shortcut or ugly code behind it. Nothing about it gets in the way of day-to-day work, so it never lands on anyone's tech debt radar.
That doesn't make it free. Today the extra storage is a rounding error on the bill, but it grows a little every time the export runs. Leave it for a few years and it becomes a much bigger job to unpick than if someone had pulled at the thread when they first noticed it.
Curiosity outside the walls
The engineers I've learned the most from are the ones who pull at those threads. They know how the strange old subsystem works, or why an awkward bit of code ended up the way it did, and usually nobody asked them to find out. At some point they just went looking.
It's a habit I picked up from them, and one I've kept. It's perfectly normal to clock in, get through what's on my plate, open a handful of PRs and bounce between contexts without ever stepping outside the walled garden of work I've been given. It's a job, after all, and that's what it asks of me. But for me, the real fun starts outside that garden.
Stepping outside it usually means going code diving (one of my favourite things to do!). I'll follow a request further than I need to, out of our own code and into the packages it leans on. Mostly I'm trying to understand why things are the way they are, rather than assuming an old decision must still be right.
Most of these dives are short detours rather than expeditions. I'm not about to spend a week shaving megabytes off files nobody downloads. They still have a habit of paying off later, though, because I'll usually spot the same pattern the moment it turns up again in a PR or in something I'm writing myself.
AI as a multiplier
AI adds an interesting twist to all of this, because it acts as a multiplier in both directions. Teams ship code faster than ever now, which means there's more room for quiet inefficiencies to slip through to production unnoticed.
It works the other way too. When I spot something odd now, I don't have to dig into it alone. I can set agents loose on half a dozen of these at once, each running as its own contained science experiment. Every one tries a few different fixes and comes back with a report: what each fix actually saves, which ones are worth pursuing, and which wouldn't work, with a list of reasons why.
These reports also help answer the "does it matter?" question from earlier. Either they back up my original answer, or they prove me wrong in some way I hadn't thought of. If the clanker and I end up agreeing on our assessment, and that it's worth fixing for clear reasons, I can take the report's findings and present them to other engineers. From there we can review and decide whether it's actually important enough to put out into the world.
Using AI for code diving has made the whole process a lot more fun, because I no longer have to pick just one thread to pull. I can keep a larger investigation running in the background while a handful of smaller ones get looked into, and have a PR up for the best of them in an afternoon, all without letting my usual responsibilities slip.
What I bring back
When I think about why I keep wandering outside the walls, it comes down to what I find out there. A package works differently from how I'd assumed, an old decision suddenly makes sense, or a corner of the codebase I'd been avoiding turns out to be perfectly reasonable once I understand it.
Sometimes what I bring back in turns into something bigger: a faster response here, a smaller export there, a fix that quietly benefits people who never knew there was a problem to begin with. Those wins are happy little accidents, and I'm always glad when they happen. What I bring back every time without fail, though, is a better understanding of the system I work in, and that makes everything I do inside the walls a little better too.