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

    is very hard to create a good inheritance structure that does not devolve over time as new requirements get added

    That’s such an important point. Whatever else folks take from this thread, I hope they catch that.

    And I’ll pile on to add - more layers is more risk. One layer of inheritance is a lot easier to keep maintaining than inheritance that goes four layers deep.

    • nous@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 month ago

      And if you only have one layer then why not just use interfaces/traits? Which are a vastly better design than inheritance.