• godfilma@lemmy.blahaj.zoneOP
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      10 days ago

      I’m not an advanced reader yet, but I’m guessing that “deriving” is some other thing you can do with classes than making them a friend.

      • Voroxpete@sh.itjust.works
        link
        fedilink
        arrow-up
        5
        ·
        10 days ago

        Generally speaking, in object oriented programming there are ways to derive one class from another. So if you have a Car class, but you decide that it would actually make sense to have a Truck class as well, you can use Car as a starting point, inherit all of its properties, and then just change the specific parts that are different for the Truck class. This saves repeating work, and allows you to build in layers; instead of Car and Truck you might start with a Vehicle class, then derive a GroundVehicle class from that, then a Bike, Car and Truck class from GroundVehicle, and so on.

    • Fushuan [he/him]@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      3
      ·
      9 days ago

      No, first is reciprocity, second is same level of transience while the third is inheritance.

      The first note says that A->B doesn’t imply B->A

      The second note says that if A->B and B->C, nothing implies that A->C or C->A.

      The third note says that people that consider you a friend don’t automatically consider your kids friends. In logic terms B->A doesn’t imply B->An.