cross-posted from: https://programming.dev/post/54023908

Hi!

I’ve never read any of Uncle Bob’s books. But I have taken interest in “Clean Architecture” as it seems like a good solution to make mid to large sized projects simple to understand and maintain.

I think MVC gets too much coupling and fails at larger projects, same with n-tier. But I’m not sure about anything right now (software design is a very complicated problem after all).

So I was wondering if you friends who have used Clean Architecture in production can share your knowledge and experience with me about this design?

Is it actually good and worth investing in?

Footnote:

I’m especially weighing this architecture because Uncle Bob’s writings are really hit and miss. I don’t see him as a master or guru so I take everything he says with a grain of salt.

  • expr@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    2 hours ago

    Bob Martin is a complete hack. He should not be regarded as an authoritative source and indeed, any claim he makes should be treated as highly suspect. He’s not worth reading.

  • JakenVeina@midwest.social
    link
    fedilink
    arrow-up
    8
    ·
    6 hours ago

    Anecdotally, from a programming support community I hang out in…

    i’ve never seen anyone promote the values of Clean Architecture in the practical world. The only reason I even know about it, really, is because it’s a pretty popular topic for amateur/beginner developers to come in and ask about, because they read a book or a blog article about it, or are being taught about it in a class. And the response is always, universally, “Don’t use Clean Architecture, use Vertical Slice Architecture.”

    I get the vibe that it’s been popularized in the same pattern as microservices or lambda functions: someone at a super-scaled company like Google or Amazon published a blog post about it, and how it works for them for some niche scenario, and everyone latched on to it as trendy, despite the fact that their scenarios are NOTHING alike

  • e8d79@discuss.tchncs.de
    link
    fedilink
    arrow-up
    8
    ·
    7 hours ago

    The less you read of Uncle Bobs writings the better but Clean Architecture isn’t really his idea(the original was called Ports and Adapters) its just a name that he coined and it unfortunately stuck.

    I think Clean Architecture is quite useful for the kinds of long-lived application development projects that you will usually encounter in larger companies. Its main appeal in my opinion is that it prevents your domain logic from becoming entangled with implementation details of the environment in which the software will run. This makes changing out dependencies easier in case you need to switch out some 3rd party services.

    Another benefit of using such a well-known architecture in general is that you will have an easier time on-boarding new developers. In a clean architecture project it should be no question where to find, for example, the database context because it will obviously live in the infrastructure layer.

    A drawback of this approach is that it can make an application more complex than it needed to be, especially if you are writing a smallish CRUD application that has little to no domain logic.

    To me the clean architecture is a good default to start with for monolithic business applications, where requirements might change drastically in the future, but as with anything else it doesn’t fit every use case. So, don’t try to write the next high performance game engine with it.

  • squaresinger@lemmy.world
    link
    fedilink
    arrow-up
    4
    ·
    6 hours ago

    As with everything, don’t take it as a gospel. It’s a tool that can be somewhat beneficial in the right circumstances, and it can also be abused and lead to horrible results if used dogmatically.

    Uncle Bob is seriously not a master or guru but instead more of a well-known blogger-turned-author.

    (And using “Clean” in the naming of a guideline is an offence that should be punished with… cavities in his teeth.)

  • Pissmidget@lemmy.world
    link
    fedilink
    arrow-up
    11
    ·
    8 hours ago

    Not the exact book, but the same author.

    I’ve read two of his books (clean code and clean coder), and there are things I agree with, absolutely. There are also things I vehemently disagree with.

    The main value I gained from them was by reflecting on the scenarios and his ideas on approaching them. Afterwards I made up my own mind on the subject.

    They contained a good deal of subjects that I, as a very junior dev at the time, hadn’t even begun to consider, and by being aware of them, I could more easily approach them when encountered in the wild.

    There’s also a historical aspect of knowing what has inspired, affected, or motivated, other ideas and approaches.

    Take it for what it is, one person’s opinions. Some you’ll probably agree with, some you won’t. Just because someone is out was regarded highly in a field does not make their word gospel. It makes it worth thinking about and forming your own opinion though.

  • Eager Eagle@lemmy.world
    link
    fedilink
    English
    arrow-up
    11
    ·
    9 hours ago

    IME it’s an interesting read and some of the problems raised are valid, but the solutions are often unrealistic and overengineered. Same with design patterns, learn them to be aware of the problems, possible solutions, and their trade offs; but don’t feel the need to warp the entire project around it.

  • nous@programming.dev
    link
    fedilink
    English
    arrow-up
    4
    ·
    8 hours ago

    “Clean” Code, Horrible Performance offers a good argument against it purely from a performance stand point. Well worth a watch. But it also does not even make code easier to maintain. It just smears logic all over the place and makes it harder to understand what is going on. Trying to follow clean code principals just makes your code worse. And if you try to point that out to anyone they just say you are doing it wrong with no proper advice on how to actually improve things.

    • Alavi@programming.devOP
      link
      fedilink
      arrow-up
      4
      ·
      8 hours ago

      I’m not talking about the “clean code” approach. I’m talking about “clean architecture” for software design.

      I have also heard things about how the multiple levels of abstraction in Clean Architecture can lead to worse performance, but we can always optimize the bottlenecks and skip the abstractions if needed. I also don’t have any actual benchmark of how much is the performance hit.

  • VibeSurgeon@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    8 hours ago

    Clean Architecture insofar as separating your application into architectural layers is broadly speaking a good thing.

    • Alavi@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      7 hours ago

      I’m specifically talking about the “Clean Architecture” design as described by Robert Martin though.