Back when people were writing code, you’d occasionally hear me say things like, “static classes are just folders”, or “a microservice is just a function”, or “anything is a monolith if you zoom out enough”, or insert any other two buzzwords you can think of.
And I’ll die on that hill. There’s truth in all of those.
Compare a microservice to a class:
- Both encapsulate code
- Both have a public API
- Both hold state
- Both have a lifecycle
- …
What is actually different?
- You can deploy a microservice independently from the rest of the codebase
- Microservices draw a harder boundary between units of code
…and I think that’s about it. The rest is mostly perspective and scale. I mean like if you have some program that can hot-reload classes, then isn’t that functionally similar to deploying a microservice?
Now, the latter gives you more isolation and fault tolerance, which may be preferable in an organization with many meat monkeys working on the same codebase. But I feel like with AI we are going to have to rethink a lot of our assumptions about code organization and deployment.
What if hot-reload is preferable sometimes, because it allows you to move fast?
And like, when I vibecode and notice the codebase is degrading and the same errors start popping up all over the place meaning a refactor is due. Then these days I’m just like, “I think this is what is happening and you should colocate these pieces of code to fix it”, followed by “look, these 5 things are actually the same thing”, and that usually solves the issue. Do I care whether the abstractions AI finds are functions, or classes, or folders? Not really.
They’re all the same anyway.
The important thing is that related code is now colocated.
One of my first blog posts on this site was about how to structure any codebase, and now that I don’t even write the code that I’m structuring anymore, it starts to become more and more obvious: Every abstraction is the same.
- There is code
- There are ways of bundling code into units
- There is a dependency graph between code units
And my job as a vibe coder is to:
- Ensure related code is colocated
- Ensure similar side effects are colocated
- Ensure the dependency graph is acyclic and as tree-like as possible
- Ensure the codebase is as declarative as possible (Anything is an interpreter if you squint hard enough)
And this is any software ever. All the rest.. the stuff that AI does now.. it’s all just mechanical. Programming languages are all the same. Virtual classes and mixins and folders and modules, they’re all the same. While and for and switch and if, they are all the same.