• ebc@lemmy.ca
    link
    fedilink
    arrow-up
    7
    ·
    1 month ago

    I’m not a Java dev, but I know enough of it to fix simple bugs in the backends I work with. My main issue with it is that 99% of the code doesn’t seem to do anything. The clear, obvious place that looks like it handles the feature you’re looking for? None of it does anything! It just instantiates another class from God knows where to actually do the work. I swear I spend most of my time in Java projects just looking for the damn implementation in a sea of AbstractSingletonFactoryBean shit.

    • lennivelkant
      link
      fedilink
      arrow-up
      2
      ·
      1 month ago

      The dev culture certainly contributes to the problem. In the attempt to modularize, isolate functionality from expectations and create reusable code, a mess of abstraction patterns have sprung up.

      I get the point: Your logic shouldn’t be tightly coupled to your data storage, nor to the presentation, so you can swap out your persistence method without touching your business logic and use the same business logic for multiple frontends. You can reuse parts of your frontend (like some corporate design default structures) for different business apps.

      But you can also go overboard with it, and while it’s technically a dev culture issue rather than a language one, it practically creates another hurdle to jump if you want to use Java in an enterprise context. And since that hurdle is placed at the summit of the mountain that is Inheritance, Abstraction and Generics… well, like I said, massively front-loaded.

      Once you have a decent intuition for it, the sheer ubiquity makes it easier to find your way around other projects built on the same patterns, but getting there can be a confusing slog.