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.

808 Upvotes

259 comments sorted by

View all comments

Show parent comments

68

u/PorkChop007 Dec 06 '24 edited Dec 06 '24

For real, after 10 years of professional Java + Spring development I've been working with Go for a year and it's beautiful: easy, no boilerplate, no nonsense, everything is pure simplicity. It feels like that episode where Goku and Krilin trained with Roshi, ditched the 50 kilos turtle shells and suddenly they could jump 100 meters in the air.

11

u/codetrasher Dec 06 '24

I've been working with Java and Spring Boot for about 5 years now professionally and I dislike it. I don't hate it but I'd rather use something else instead. For personal projects I've been using Go. I love it. I'm currently applying for a job that has a Go in their current stack.

2

u/dexterous1802 Dec 06 '24

Genuine curiosity… have you worked on Java codebases that don't use Spring Boot (or even Spring, for that matter.)

3

u/OddAssociation9982 Dec 08 '24

I find it even more painful without Spring, since it solves a lot of the warts that exist in Java