Skip to content

Comment on Dependency Injection with Goparent

Comments

Yeah. I think the fear of a verbose `main` is wrong. It's OK for complicated code to look complicated. If your app needs to initialize a lot of complex network dependencies at startup, then maybe your startup routine is going to have a lot of code. No big deal.

Software is complex. We all repeat, and try to follow, the mantra of writing simple code that does one thing. We succeed a lot of the time. But sometimes, we just need to do something f'n complicated. Better to express the complexity in type safe, debuggable code that everyone understands, than to hide it behind some framework.

I think developers should be more accepting of a code base that's 95% clean and 5% messy. "The perfect is the enemy of the good."

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.