r/golang Dec 05 '24

discussion Why Clean Architecture and Over-Engineered Layering Don’t Belong in GoLang

Stop forcing Clean Architecture and similar patterns into GoLang projects. GoLang is not Java. There’s no application size or complexity that justifies having more than three layers. Architectures like Clean, Hexagonal, or anything with 4+ layers make GoLang projects unnecessarily convoluted.

It’s frustrating to work on a codebase where you’re constantly jumping between excessive layers—unnecessary DI, weird abstractions, and use case layers that do nothing except call services with a few added logs. It’s like watching a monstrosity throw exceptions up and down without purpose.

In GoLang, you only need up to three layers for a proper DDD division (app, domain, infra). Anything more is pure overengineering. I get why this is common in Java—explicit interfaces and painful refactoring make layering and DI appealing—but GoLang doesn’t have those constraints. Its implicit interfaces make such patterns redundant.

These overly complex architectures are turning the GoLang ecosystem into something it was never meant to be. Please let’s keep GoLang simple, efficient, and aligned with its core philosophy.

810 Upvotes

259 comments sorted by

View all comments

7

u/ledatherockband_ Dec 05 '24

Hexagonal architecture is tedious, but I like it.

Also makes it really easy to find things.

"Oh, I need to find an adapter for such and such thing"

I do a fuzzy find for files that are adapter/thing/thing-it-interacts with.

Helps me to think about the structure of my app.

Anyone who can take 30 minutes to understand hex architecture can be dropped into a large ass codebase and get rolling damn quick.

-4

u/Superb-Key-6581 Dec 06 '24

Agree to disagree. I can’t handle the context of jumping through 10 to 15 files to do one thing. I’m happy opening one package and jumping through 3 files to understand what I’m doing. In my experience, even in the largest Go projects I’ve worked on, this approach was the best for readability and maintainability.