this post was submitted on 24 Jul 2026
35 points (100.0% liked)
Programming
27880 readers
319 users here now
Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!
Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.
Hope you enjoy the instance!
Rules
Rules
- Follow the programming.dev instance rules
- Keep content related to programming in some way
- If you're posting long videos try to add in some form of tldr for those who don't want to watch videos
Wormhole
Follow the wormhole through a path of communities !webdev@programming.dev
founded 3 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I used to like clean architecture. I implemented it in some large monolith applications but later on changed it. What stayed is the seperation of things by giving a dependency to a module/struct/class/object (via a constructor). The object does not need to know what has been passed to it, only that it can for example store something. The storing of something can be saving it to an SQL database, to a file, print it to console, etc. So basically inversion of control. And the basic breakup between the domain logic/business logic and the things that does the heavy lifting like a database handler, API handlers, etc.
Agreed, DI in moderation can be useful. I generally like to target dependencies with I/O so they can be substituted with test doubles to allow the domain logic to be tested with fast, deterministic tests. On the other hand, I’ve seen codebases that go way overboard with SOLID and create unmaintainable messes that are difficult to reason about.
Yeah, that's always the thing. Sometimes it is good to have a strict guideline/structure to prevent a mess but that itself can be the source if the mess. As it n way to complicated with many unnecessary abstraction layers while a simple direct call to a function would also be good enough.