• FishFace@piefed.social
    link
    fedilink
    English
    arrow-up
    2
    ·
    3 months ago

    Great article.

    A lot of people are on the “composition over inheritance” bandwagon now, but I’ve honestly not seen a situation where I felt that inheritance was used and was the wrong choice. (Though most of my experience is in python where there’s no diamond problem, mixin classes are common, etc)

    What I noticed is that everyone seems to agree that inheriting implementation is useful, because you have that with traits in rust (which are agreed to be good, afaik), so in languages without traits, it seems reasonable to want to use the next best thing

    • Feyd@programming.dev
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      3 months ago

      In the 90s, a lot of c++ and Java code was giant trees of inheritance and everyone always talked about design like all real code fit neatly into hierarchies like the examples about animals and whatnot. There are always fashionable ways to overengineer and for a time it was OOP abuse, and the sane people that had to live through it honestly have some trauma over it and difficulty explaining just how bad it was because newer people have never seen the insanity.