As a Java engineer in the web development industry for several years now, having heard multiple times that X is good because of SOLID principles or Y is bad because it breaks SOLID principles, and having to memorize the “good” ways to do everything before an interview etc, I find it harder and harder to do when I really start to dive into the real reason I’m doing something in a particular way.

One example is creating an interface for every goddamn class I make because of “loose coupling” when in reality none of these classes are ever going to have an alternative implementation.

Also the more I get into languages like Rust, the more these doubts are increasing and leading me to believe that most of it is just dogma that has gone far beyond its initial motivations and goals and is now just a mindless OOP circlejerk.

There are definitely occasions when these principles do make sense, especially in an OOP environment, and they can also make some design patterns really satisfying and easy.

What are your opinions on this?

  • iii@mander.xyz
    link
    fedilink
    English
    arrow-up
    26
    arrow-down
    2
    ·
    edit-2
    24 hours ago

    Yes OOP and all the patterns are more than often bullshit. Java is especially well known for that. “Enterprise Java” is a well known meme.

    The patterns and principles aren’t useless. It’s just that in practice most of the time they’re used as hammers even when there’s no nail in sight.

        • iii@mander.xyz
          link
          fedilink
          English
          arrow-up
          4
          ·
          edit-2
          22 hours ago

          Can I bring my own AbstractSingletonBeanFactoryManager? Perhaps through some at runtime dependency injection? Is there a RuntimePluginDiscoveryAndInjectorInterface I can implement for my AbstractSingletonBeanFactoryManager?

    • SinTan1729@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      arrow-down
      2
      ·
      17 hours ago

      As an amateur with some experience in the functional style of programming, anything that does SOLID seems so unreadable to me. Everything is scattered, and it just doesn’t feel natural. I feel like you need to know how things are named, and what the whole thing looks like before anything makes any sense. I thought SOLID is supposed to make code more local. But at least to my eyes, it makes everything a tangled mess.

      • Matty Roses@lemmygrad.ml
        link
        fedilink
        arrow-up
        3
        arrow-down
        1
        ·
        14 hours ago

        It’s not supposed to make it more local, it’s supposed to conform to a single responsibility, and allow encapsulation of that.

      • iii@mander.xyz
        link
        fedilink
        English
        arrow-up
        4
        ·
        17 hours ago

        Especially in Java, it relies extremely heavy on the IDE, to make sense to me.

        If you’re minimalist, like me, and prefer text editor to be seperate from linter, compiler, linker, it’s not pheasable. Because everything is so verbose, spread out, coupled based on convention.

        So when I do work in Java, I reluctantly bring out Eclipse. It just doesn’t make any sense without.

        • SinTan1729@programming.dev
          link
          fedilink
          English
          arrow-up
          3
          ·
          edit-2
          17 hours ago

          Yeah, same. I like to code in Neovim, and OOP just doesn’t make any sense in there. Fortunately, I don’t have to code in Java often. I had to install Android Studio just because I needed to make a small bugfix in an app, it was so annoying. The fix itself was easy, but I had to spend around an hour trying to figure out where the relevant code exactly is.