Sneaky code bites back, I realised that again recently.
I realised I'd been writing terrible code when I couldn't explain it to myself.
The code worked. It was adding SQLite support to Pongo. But when I tried to describe how I was implementing multi-database support, I heard myself saying:
"First it checks if the Promise is cached, then it creates a proxy that defers to the real implementation which doesn't exist yet, but will be loaded dynamically when..."
Insane, I was going insane.
It's a pattern we all fall into.
We see repetition and think, "I can abstract this."
We see explicit configuration and think: "I can infer this". We see upfront costs and think: "I can defer this".
Sometimes we just don’t trust our colleagues, thinking that they’re too incompetent and we need to take precautionary steps.
Sometimes we're right. Most often we’re not.
Too often, we're optimising the wrong metric. I was optimising for fewer imports, not simpler code. I was hiding essential configuration, not accidental complexity.
A minimal API with complex implementation isn't simple—it's a lie. The complexity doesn't disappear. It moves from the visible surface to hidden internals, where it's harder to understand, debug, and modify.
I got too clever. We all do sometimes. The key is catching it before it escapes into production, where it becomes someone else's nightmare.
Now I'm removing this code, and that's fine.
Want to read details? Check the latest #ArchitectureWeekly https://www.architecture-weekly.com/p/sneaky-code-bites-back
And tell me about your sneakiness.
How hard did it bite you?
Sneaky Code Bites Back
I was adding SQLite support to Pongo when I realised that I'm talking to myself, and what I heard was insane. I was trying to understand and recap what I just built, an extremely clever and sneaky solution to handle multiple databases. I realised I was wrong, and that sneaky code will soon bite me back. Why?