• GreenKnight23@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      1 day ago

      that’s because anyone who develops oop in Python is mentally ill.

      Python is a scripting language, not to be confused with an actual programming language. Like everything else in development over the last decade, newbs are just shoehorning whatever is hot into the language because nobody is stopping them.

      • dejected_warp_core@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        edit-2
        9 hours ago

        that’s because anyone who develops oop in Python is mentally ill.

        Hard disagree there. I would argue that most “multi-paradigm” languages converge on the same features, given enough time to iterate. It’s not necessarily about hot-sauce. I honestly think its about utility and meeting your userbase where their heads are.

        • GreenKnight23@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          7 hours ago

          I honestly think its about utility and meeting your userbase where their heads are.

          then the Python userbase must have their heads shoved up their ass.

      • Albbi@piefed.caOP
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 day ago

        You’re right in that OOP feels very shoehorned in with Python. But not every project has a Linus Torvalds to publicly humiliate horrible ideas and implementations.

        • fruitcantfly@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          22 hours ago

          In what way does OOP feel shoehorned in with Python? I ask since that is not my own impression of the language.

          Would you also be willing to share what language(s) you feel do(es) OOP without it being shoehorned in?

          • amos@lemmy.zip
            link
            fedilink
            English
            arrow-up
            0
            ·
            18 hours ago

            Yeah, some weird accusations. Python has had classes since its inception (1.0).

            Also the image in the post makes no sense. It shows multiple (Spidey) instances all pointing to each other which is not how self works. self is just a parameter that may contain different instances depending how it was called. This is also true for any other parameters in any function, each time a function is called it may have a different instance.

      • Kay Ohtie@pawb.social
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 day ago

        C/C++ are just scripting languages that have to become OS+arch -specific byte-code before execution.

        • GreenKnight23@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          1 day ago

          c and c++ require compilation to run though. Python does not. it runs through an interpreter. thus it’s a scripting language.

          same can be said for node, ruby, and other interpreted languages.

          the problem with Python specifically is that it can’t define itself as more one than the other. this makes developing in it messy and difficult because it refuses to adopt one over the other and fails to standardize. that’s why we get little idiosyncrasies like the self referencing OOP in Python. it’s been shoved into the language without any real concern for maintainability or longevity in the language and is only meant to fit into every crack and crevasse, like a putty(or shit).

          it took almost two decades for them to implement a switch/case that doesn’t even work like 99% of all languages because it was an afterthought. when devs complained through official channels they were told to pound sand.

          Python is a hammer in a screw driven world. You can nail those screws in to solve your problems, but you’ll never get them back out.

          Python doesn’t deserve half of the praise it gets because they continue to piss on developers and have the audacity to tell them it’s rain. not only that, the corporate interests (google) are pulling financial support of the language for the “new thing”.

          my hope is that Python gets the same treatment that the Python community gave to devs.

          • Kay Ohtie@pawb.social
            link
            fedilink
            English
            arrow-up
            0
            ·
            1 day ago

            Python is compiled at “runtime” to a similar OS+arch byte-code minus ELF headers that Linux binaries typically have from gcc.

            My point was it’s a stupid distinction and worthless when the other points about poor implementations of common language frameworks are plenty on their own is all, and it’s needlessly snobbish.

            As far as class variable reference however I wish more languages self-referenced. In my eyes it makes it far clearer at a given line of code glance as to where the hell a value came from as opposed to just by name. I feel a keyword like self::variableName, or maybe more aptly &self as a pointer to reference in C++ would be very clear, like Rust does, which is very much, by the original definition, a programming language instead of scripting. Even Java, which is definitely not a scripting language though is still run inside a virtual machine, uses this. I don’t personally like the term versus self, but eh.

            Though if you want a hammer in a screw-driven world look no further than Electron. I think it puts anyone else’s even purposeful attempts at such to shame.

    • Albbi@piefed.caOP
      link
      fedilink
      English
      arrow-up
      0
      ·
      1 day ago

      Write a new method, make sure to reference my self first. Write a new method, make sure to reference myself first. Call the method, make sure to reference myself first.

      Yeah, I can see it.

      • amos@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        18 hours ago

        You don’t reference self when calling a method, what on earth are you talking about? You start with the instance when calling the method, like most/all other OOP languages.

        Also there are benefits with the explicit self/this to access instance properties. In C++ you need to make sure all class properties/members have a naming scheme that does not conflict with potential parameter names or other names of other variables.