No offence

      • vrighter@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        it is a horribly slow, ugly language, with the most braindead scoping rules (apart from js, of course). The only fast parts of it are libraries written in other languages, because python itself is not up to the task for anything more than glueing code from other, better languages together.

    • Redrum714@lemm.ee
      link
      fedilink
      arrow-up
      0
      arrow-down
      1
      ·
      1 year ago

      Glad C++ will be the one step on it cause it deserves it. I’d take PHP over that shit any day

  • dontblink@feddit.it
    link
    fedilink
    arrow-up
    0
    ·
    1 year ago

    May i ask why everyone hates JavaScript so much? It’s not ironic it’s a real question, i can’t really get it, is it just because it doesn’t have types? Or there’s more?

    • masterspace@lemmy.ca
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      1 year ago

      It’s wild that Python is getting a shoutout over javascript despite being an even bigger loosely typed mess.

      I think it’s partially because Python has a reputation as being a serious language for serious people because it’s popular amongst data scientists and academics, whereas Javascript is still seen as being popular amongst script kiddies and people building crappy websites for $100 / pop.

      That being said, most of the time i hear javascript jokes at work they’re pretty tongue in cheek /ironic / the dev isn’t really hating on it. I have heard a dev or two make those javascript jokes with a more serious critical tone, and everyone tends to ignore them and not engage because they’re pretty clearly just haters who have a general tendency to dislike popular things.

      • Faresh@lemmy.ml
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        If by «loosely typed» you mean weakly typed, then that’s not true. Python is a dynamically and strongly typed language. Attempting to do an operation with incompatible types will result in a TypeError.

        >>> "3" + 9
        Traceback (most recent call last):
          File "", line 1, in 
        TypeError: can only concatenate str (not "int") to str
        

        You may be thinking of the following, but this only works because the __mul__ and __add__ methods of these objects have been written to accept the other types.

        >>> "A" * 4 + "H"
        'AAAAH'
        
        • masterspace@lemmy.ca
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          I meant that you do not declare types and a variable’s type can change at any time.

          Regardless of semantics, it results in code that is not scannable.

          • Faresh@lemmy.ml
            link
            fedilink
            English
            arrow-up
            1
            ·
            1 year ago

            But it is in no way worse than javascript in that regard, though?

            I don’t think static typing in Python is really so essential. I see it above all as a scripting language, so its applications don’t benefit as much from static typing as other languages do.

            Maybe a better hypothetical python would have used some kind of type inference system, like in haskell, which allows for static typing while still allowing to write code unencumbered from types and stuff, but I really think, for Python’s target domain, its type system is actually adequate or good. Maybe its documentation could benefit from type hints, though.

            • masterspace@lemmy.ca
              link
              fedilink
              English
              arrow-up
              2
              ·
              1 year ago

              But it is in no way worse than javascript in that regard, though?

              No, but OPs original post was implying that it was better than JavaScript, when in my mind they’re pretty similar in that regard, with the major exception that there is no python equivalent of Typescript which is rapidly passing JavaScript in professional settings.

              I don’t think static typing in Python is really so essential. I see it above all as a scripting language, so its applications don’t benefit as much from static typing as other languages do.

              For a scripting language it’s fine, but problems arise when you start building giant applications with it (which does happen).

    • Kryomaani@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      While true, there are some languages that are the wrong tool for every job. JS is one of them. I’ve dreamt of a future where web frontends switched to something sane but instead we got stuff like typescript which is like trying to erect steel beams in quicksand. For web frontends I can understand that historical reasons have lead to this but whoever came up with node thinking JS would be a great backend language has a lot of explaining to do.

      • ParsnipWitch@feddit.de
        link
        fedilink
        English
        arrow-up
        0
        ·
        1 year ago

        I am also interested if anyone can tell me the exact time in our history when JavaScript turned from “Don’t you ever use that anywhere on your websites!” into “It’s basically every website”.

        • abraxas@lemmy.ml
          link
          fedilink
          English
          arrow-up
          0
          ·
          1 year ago

          It was when better sandboxing came out and the only valid complaints about javascript became invalid.

          I was there. It was a good time.

    • pazukaza@lemmy.ml
      link
      fedilink
      arrow-up
      0
      ·
      1 year ago

      Come on, Javascript is pretty nasty. Trying to read that shit always gives me brain tumors. Why do they need to wrap every fucking thing in a function inside a function inside a function that is passed as a parameter to a function inside another function?

      Like, bro, you know people are meant to understand what you just wrote?

      It just gives too much freedom and people forget they need to write code that is easy to read for people who aren’t totally familiar with the code base.

      They even bring that shit into typescript. Like they are already using a language that is meant to fix that shit and they are like, nope, let me create 5 nested functions just because.

      • NotSteve_@lemmy.ca
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        1 year ago

        Can you give an example of the multi nested functions? I was a TS dev for a while and don’t remember anything like that. Unless you mean the promise callback functions. Those were a mess but luckily we’ve mostly moved away from those

        • pazukaza@lemmy.ml
          link
          fedilink
          arrow-up
          0
          ·
          1 year ago

          People creating functions as objects inside of other functions. A few days ago saw a person create a function with two object functions inside, then passed one of the functions as an argument to the other function. Then returned the second function.

          It’s hard to find such a mess in other languages. Yeha, functions as objects are cool. Closures are also cool… But why abuse that shit?

          • NotSteve_@lemmy.ca
            link
            fedilink
            arrow-up
            1
            ·
            1 year ago

            Ahh I remember that sort of JS programming from way back. Do people still do that?? You can just create a class now