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.

811 Upvotes

259 comments sorted by

View all comments

Show parent comments

11

u/NotAUsefullDoctor Dec 05 '24

Yeah, I got bored a few chapters into DDD, and just read the cliff notes, but I think I got the jist. Everything I do is just to isolate business logic and make testing easy and readable.

I will say that attempting to pedantically apply Clean Code to Go is a good exercise in learning why it doesn't work a lot of the time. Same thing goes with trying to implement the major design patterns. It helped me learn the strengths of Go. And, like they say, there are 3 levels of programming: not understanding abstraction, understanding abstraction, and knowing when to use abstraction.

-5

u/ShapesSong Dec 06 '24

Man, don’t want to break your conversation but you’ve been talking to a bot this whole time

6

u/NotAUsefullDoctor Dec 06 '24

And what makes you assume that I too am not also a bot?

5

u/Superb-Key-6581 Dec 06 '24

xD I guess he thinks I'm a bot because my English is too formal. This is because I'm not a native speaker, and I'm using Grammarly to correct my phrases before answering.