karloscodes

Names yes, geometry no

· 2 min read

AI-aided. I wrote the first version. AI helped me polish the writing.

You learned hexagonal architecture at a job with hundreds of engineers, and it made sense there, layers as treaties between teams, interfaces as borders no one crosses without paperwork. Then you started something small. A side project, a tiny company. And you brought the hexagon with you, because that’s what professional code looks like.

The skills transferred. The context didn’t.

Keep the half that costs zero lines of code, the names. Domain-Driven Design got this part right, and it’s the thin part of a thick book. Call things what the business calls them. If the accountant says invoice, the class is Invoice, not BillingDocumentEntity. Draw boundaries as vocabulary. This module talks about shipments, that one about payments, and they don’t borrow each other’s words. That is thinking rather than architecture, and it’s worth the same at any headcount. The rest of the DDD catalog, the aggregates and repositories and factories, is geometry by another name. Leave it in the book.

The geometry’s promise is that someday you’ll swap Postgres, and someday the big refactor will glide along those segregated interfaces. At the old job that was fine, because the premium was split across a hundred engineers, and insurance you never claim is what bigness costs. In a five-person company the premium lands on all five of you, or on you alone. The DTOs, the mappers, the interfaces, the wiring. A handful of hands maintains all of it, waiting for a someday that was never yours to begin with.

The hexagon was a treaty between a hundred hands in one codebase. There’s no one to sign treaties with anymore. Code that fits in one head needs no protection from other heads, and smallness already does the hexagon’s job.

Staying small is a decision with champions. 37signals has run Basecamp on one monolith since 2004, with a programming team that stayed small on purpose. They refused the bigness so they’d never need the treaties.

So name the modules after what the business calls them, and write the code inside them the plain way. The day a second team shows up and needs a border, add the interface then, and not a day before.

New posts in your inbox. Unsubscribe anytime.

Or grab the RSS feed.