• MajorHavoc@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        1 month ago

        Yep. I’m old, cranky, and prone to broad statements to get reactions.

        That said, for any of you all that love inheritance, I’m judging you so hard. So hard. Very judged. I probably hate your code, and your friends’ code, and your last teacher’s code. Especially your last teacher’s code.

  • olafurp@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    Using classes is nice tbh. Using inheritance usually isn’t. Inheriting from inherited class should be forbidden.

    • Blemgo@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 month 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.