The Bloat

As any organically evolved imperfect software, my app grew its own home-brewed unplanned core data structure that almost every system depends on. Uprooting, or even slightly shaking it, might cause seams in unforeseen reaches of the codebase.

Mine is an internal intermediate representation of songs and the choreography around them. The core app is written in TypeScript while many services for generating and analyzing the music are written in Python.

Songs have to be represented and handled in both ecosystems. Sometimes we also have to convert them to or from MusicXML. That can be an intricate process, as there are non-obvious discrepancies.

But the details don’t really matter — not for you to read about, and not even for me to think about. This is a classic black box for an agent to build. We know exactly what we want to put in, we know exactly what we want to come out, and we have an easy automated way to verify the whole thing.

We just need it to work. Not a single soul will care if it’s a heaping steaming pile of garbage code so long as the job is done and the right input maps to the right output.

The internals are decoupled from the outside world — no one nowhere should give a thought to what’s inside the belly of the beast.

And yet, I care. I looked. I got curious during a code review.

Code of the highest quality
Code of the highest quality

Among the highlights:

This is horrible. And stupid. And not important in the slightest.

So I was sitting in the garden, smoking a cigarette, thinking: When will I ever get to fix this? And the answer is: Never.

I will never have a day where this will be my top priority. I will never care enough to put it on the roadmap, will never sneak an hour at night to get it polished.

The most I can do is fire away one of the myriad template deslop prompts I routinely have at the ready and pray it smooths things over rather than slaps another over-engineered patch on top.

This is the right call, but it does not make me happy.

I could only find one future scenario that will force me to wade into a refactor of this mess: if it prevents the agent from swiftly creating other messes.

Can God create a stone so heavy that even He could not lift it? I don’t really care. But I do know that AI can write code that is too complex for an AI to understand.

If and when this module will grow enough tentacles to make further changes a cumbersome, hairy, token-heavy, and error-prone effort, then I’ll have no other option than to roll up my sleeves and yell at my robot to mow down the lawn.

Until then we just live the with bloat.