var Turtle1 var Turtle2 var Is_Turtle

      • @[email protected]
        link
        fedilink
        11
        edit-2
        8 days ago

        Have you considered multiple inheritance. It’s an upgrade. All upside, literally no downside. I’m trustworthy. Trust me.

        • KeriKitty (They(/It))
          link
          fedilink
          English
          58 days ago

          Idunno, my mom told me not to talk to _stranger_s 🤔

          … She said a lot of things that were BS, though, so maybe you’re cool I guess? 🤷

          • @MajorHavoc
            link
            27 days ago

            Wow. “peak shareholder value” is what I shall now call “multiple inheritance”, from now on.

      • Dr. Wesker
        link
        fedilink
        English
        6
        edit-2
        8 days ago

        When you start learning about different paradigms, you’ll likely learn much more about inheritance when learning about the Object Oriented design paradigm.

        To overly simplify, you create objects that inherit attributes from other objects. It’s for instance a way to create reusable patterns, that have stronger and more reliable data structures.

        I made the joke comment, because for instance, you could create a Turtle class, and always know it was a Turtle. Again, an oversimplification.

        EDIT: I should also add that for some reason OOP is an oddly divisive subject. Developers always seem to want to argue about it.

          • @MajorHavoc
            link
            17 days ago

            At this point I think there is no software dev topic that is somehow not devisive.

            Now I want to try something:

            “Boolean variables don’t suck.”

            • @[email protected]
              link
              fedilink
              2
              edit-2
              7 days ago

              No one uses Boolean values anyway and with the amount of resources available on modern systems we can just replace them with integers and we should be fine. This also makes it easier to teach people, as they would learn less different data types.

              Yes I’m a software dev :)

          • @arendjr
            link
            37 days ago

            Just keep in mind that inheritance is nowadays a very contested feature. Even most people still invested in object oriented programming recognise that in hindsight inheritance was mostly a mistake. The industry as a whole is also making a shift to move more towards functional programming, in which object orientation as a whole is taking more of a backseat and inheritance specifically is not even supported anymore. So yeah, take the chance to learn, but be cautious before going into any one direction too deeply.

            • magic_lobster_party
              link
              fedilink
              17 days ago

              I like to mix between OOP and FP for different levels. OOP is great for higher architectural problems. FP is great for everything under it.

              And yes, inheritance was a huge mistake. Just use composition and interfaces instead.

          • Dr. Wesker
            link
            fedilink
            English
            1
            edit-2
            8 days ago

            If I could give a suggestion I wish I had gotten much earlier on in my education and career, it would be to really spend some time learning about the different paradigms, and their best use cases. You will likely ensure yourself a strong foundation in software architecture.

            • @[email protected]OP
              link
              fedilink
              18 days ago

              I’ll check it out! I’m very casual and doing thus mostly as a passion/Fun project. But I love any direction thank you:)

      • @[email protected]
        link
        fedilink
        3
        edit-2
        7 days ago

        Inheritance established “is a” relationship between classes.

        class Turtle;  
        class TigerTurtle is a Turtle (but better);  
        class BossTurtle is a Turtle (but better);  
        

        Underlying classes hold an inner object to the super class, everything from Turtle will be in TigerTurtle and BossTurtle.

        In some languages that is configurable with public, private, protected keywords.

        Relatedly, there’s also composition, which establishes a “has a” relationship:

        class TurtleTail;
        class Turtle:
          var tail: TurtleTail; (has a tail);
        

        Since Turtle is NOT a tail, but a whole animal, turtle should not inherit TurtleTail. But it HAS a tail, thus we add turtle tail as a property.

        • @[email protected]
          link
          fedilink
          3
          edit-2
          7 days ago

          I’m only commenting because the actual python is practically pseudo code:

          
          # A turtle class
          class Turtle:
              shell=True
          
          # A boss class
          class Boss:
              authority=True
          
          #A class that inherits from another
          class TigerTurtle(Turtle):
              fuzzy=True
          
          # Multiple inheritance, or "The Devil's Playground"
          class TigerBossTurtle(TigerTurtle, Boss):
              #  shell, authority, and fuzzy are all true
              ...