• Blemgo@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      I think the main problem is that people try to shoehorn OOP mechanics into everything, leading to code that is hard to understand. Not to mention that this is basically encouraged by companies as well, to look “futuristic”. A great example of this approach going horribly wrong is FizzBuzz Enterprise Edition.

      OOP can be great to abstract complex concepts into a more human readable format, especially when it comes to states. But overall it should be used rarely, as it creates a giant code overhead, and only as far as actually needed.

      • seth@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        5 months ago

        I got as far as seeing they chose Java and opening the constants file, and immediately executed a strategic withdrawal. I love that people went to this level of detail

    • HStone32@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      If you ask me, the only reason for objects to exist are for preventing stale references. Anything more than this is unnecessary.

    • Valmond@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      5 months ago

      People (sometimes) use it far too much and in wrong ways.

      Like inherit when you could just instantiate, or use a template.

      Or when “everything should be a class” was also a bummer (inhetit “run()”), like I’d instantiate “main” twice (cool if it had worked I guess).

      Or old code written by “wizards” where they cast cast cast instances onto other classes to use specific behaviour in crazily dangerous manners. And you’re the one to “fix it” because it doesn’t work well…

      Otherwise OOP is good.