• mesa@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    22 days ago

    Its the best/worst thing about OOP no matter what language.

    We had a rule at work that if you are 3 levels or more down an inheritance tree, then you are too far. The cognitive load is just too much, plus everything stops making sense.

    One level can be great (MVC all have great conventions, MCP as well). Two can be pushing it (Strategy pattern when you have physical devices and cant be connected all the time, Certain kinds of business logic that repeat hundreds of times, etc…) But even there you are kinda pushing it.

    I need code that I can look at a month from now and know WTF is happening. And sometimes its better to have less DRY and more comprehension. Or maybe im just a forever mediocre dev and dont see the “light”. I dunno.

    • Ethan@programming.dev
      link
      fedilink
      English
      arrow-up
      1
      ·
      21 days ago

      When I first started using Go I bemoaned the lack of true inheritance and classes. Now I love it.

    • fibojoly@sh.itjust.works
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      21 days ago

      PTSD flashbacks to the codebase I started on in 2008 which had… I don’t even remember. Like six or seven levels. Fucking nightmare. I did a printout of the analysis Doxygen gave me and it ended up as a 4x3 meters poster ;_;