Stop comparing programming languages

  • Python is versatile
  • JavaScript is powerful
  • Ruby is elegant
  • C is essential
  • C++
  • Java is robust
  • @witx@lemmy.sdf.org
    link
    fedilink
    311 months ago

    I was caught by surprise and for some reason this joke clicked so much that I laughed for a while. Kudos

  • Rose
    link
    fedilink
    3111 months ago

    JavaScript is powerful

    Old joke (yes, you can tell):

    “JavaScript: You shoot yourself in the foot. If using Netscape, your arm falls off. If using Internet Explorer, your head explodes.”

  • chraebsliOP
    link
    fedilink
    20011 months ago
    • PHP is old
    • HTML is NOT A PROGRAMMING LANGUAGE!!!
    • CSS is
      ︎ ︎ ︎ not alig-

    ︎ ︎ ︎ ned

    • dohpaz42
      link
      fedilink
      English
      4911 months ago

      PHP is old

      Same age as Ruby, Java and JavaScript, but younger than Python, C, and C++. 😛

    • DacoTaco
      link
      fedilink
      411 months ago

      Modern php is not bad actually. Still kinda slow and dangerous, but A LOT better than it used to be :')
      That said, i wouldnt build a web service with php still lol

    • chraebsliOP
      link
      fedilink
      211 months ago

      Actual definitions (my opinion):

      • HTML is website
      • CSS is style
      • JS is everywhere
      • SQL is data
      • Python is simple
      • PHP is backend
      • Markdown is README
      • YAML is config
  • luciole (he/him)
    link
    fedilink
    3611 months ago
    • C++ is fine
    • Python is fine
    • C# is fine
    • PHP is fine
    • JavaScript is fine
    • C is fine
    • Java is fine

    I could go on

      • @CanadaPlus@lemmy.sdf.org
        link
        fedilink
        1511 months ago

        JavaScript is also not fine.

        C++ apparently has a lot of footguns if you use too many parts of it. C and orthodox C++ are fine.

        • polonius-rex
          link
          fedilink
          10
          edit-2
          11 months ago

          people say this but C is significantly more batshit than javascript

          oh you used scanf? one of the basic functions of our language? sorry that’s got a buffer overflow vulnerability so now your application is compromised

          • @CanadaPlus@lemmy.sdf.org
            link
            fedilink
            8
            edit-2
            11 months ago

            Yeah, but as far as I understand that’s not a C vulnerability. It wasn’t added. C just exposes how the underlying CPU works.

            If you could avoid exposing dangerous memory quirks but still retain the same power… well, you’d have invented Rust. Rust is a better language than C, I agree with that.

            Edit: Yep, just double checked. Buffers live in physical memory and have to be finite, so if you advance outside of them you’ll go somewhere else. Scanf’s not special, this is just another inherent pointer issue.

            • polonius-rex
              link
              fedilink
              611 months ago

              exposing the machinations of the underlying CPU with no regard for safety is like, the definition of a footgun

              • @CanadaPlus@lemmy.sdf.org
                link
                fedilink
                6
                edit-2
                11 months ago

                Okay, but how do you code on a CPU without directly interfacing the CPU at some point? Python and JavaScript both rely on things written in mid-level languages. There’s a difference between a bad tool and one that just has limitations inherent to the technology.

                Like, to echo the meme a bit, it’s not a totally straight comparison. They have different roles.

                • polonius-rex
                  link
                  fedilink
                  511 months ago

                  a footgun isn’t inherently bad, it just implies a significant amount of risk

                  yes, if you need the ability to code on a low level, maybe C is necessary, but the times where that is actually necessary is smol

                  also rust

            • xigoi
              link
              fedilink
              English
              111 months ago

              What’s the point of having a function in the standard library if the universal recommendation is to never use it?

              • @CanadaPlus@lemmy.sdf.org
                link
                fedilink
                1
                edit-2
                11 months ago

                Is that the recommendation? This is the first time I’ve actually seen it discussed.

                I’m wondering at this point if a new, different stdlib would be better. Or just use Rust.

                • xigoi
                  link
                  fedilink
                  English
                  111 months ago

                  To be honest, my comment probably applies more to gets, but the point is the same.

      • @9point6@lemmy.world
        link
        fedilink
        1011 months ago

        IIRC JavaScript + TypeScript is the biggest demographic of engineers in the industry if you go by GitHub stats

        I suppose you could call that power in a way

      • Ace! _SL/S
        link
        fedilink
        5111 months ago

        By running everthing in a single thread obviously. Won’t get more powerful than that

      • polonius-rex
        link
        fedilink
        1311 months ago

        good luck doing frontend development without it, but it can also do backend development

        it can do everything

        • @odium@programming.dev
          link
          fedilink
          13
          edit-2
          11 months ago

          That makes it versatile, not powerful.

          When I hear powerful language, I think of languages that are good at intensive tasks like assembly, c, rust, Python (because of numpy, pandas, pyspark, cuda, etc.).

          • @echindod@programming.dev
            link
            fedilink
            1311 months ago

            Python is powerful because it easily wraps C libraries that do real work! Just kidding mostly.

            But yeah, js isn’t a language I would describe as powerful. Ubiquitous? More capable than you would expect given it’s history? Bloated?

            • @CanadaPlus@lemmy.sdf.org
              link
              fedilink
              5
              edit-2
              11 months ago

              Python is powerful because it easily wraps C libraries that do real work! Just kidding mostly.

              Not kidding. There’s no rule against that though. It’s good at it’s niche.

              • @9point6@lemmy.world
                link
                fedilink
                111 months ago

                Does that not put JS (node) back on the table?

                I’d say it’s the low level language doing the heavy lifting, python or JS in this scenario are just front-ends.

                Hell, I think FORTH has C bindings, that’s not power, that’s mental illness

                • @CanadaPlus@lemmy.sdf.org
                  link
                  fedilink
                  711 months ago

                  Sure, but there are good and bad frontends. JavaScript has a tendency to silently fly off the handle in mysterious ways due to the crazy type system. Python will typically fail more predictably, and is famously easy to write. I know nothing about FORTH, honestly.

          • polonius-rex
            link
            fedilink
            1011 months ago

            i wouldn’t want to program in pure assembly either but asm is definitely powerful

            • wreel
              link
              fedilink
              English
              711 months ago

              I would argue that ASM isn’t “powerful”. It’s direct. You can access advanced features of a CPUs architecture with the trade off limited portability. Sometimes it’s necessary but power comes from being able to express complex control and data structures in a concise and readable amount of text.

              The subjective topic of what “concise and readable” means is where the language wars come in.

        • @lseif@sopuli.xyz
          link
          fedilink
          111 months ago

          if its acceptable to force javascript onto the backend and everywhere else, then why not write the frontend in rust, or anything else than can compile to wasm ?

          • @BatmanAoD@programming.dev
            link
            fedilink
            511 months ago

            WASM has no native ability to access most web APIs, including the DOM. JavaScript is literally unavoidable on the front end.

            • @lseif@sopuli.xyz
              link
              fedilink
              1
              edit-2
              11 months ago

              javascript cannot be compiled natively for the backend or desktop either…

              also libraries like wasm bindgen allow a developer to write almost no javascript. and i wouldnt could a few lines of bootstrapping.

              im dont advocate for wasm when its not necessary. nor do i advocate for backend js when its not necessary.

              • @BatmanAoD@programming.dev
                link
                fedilink
                311 months ago

                Sorry, I’m not sure what your point is. I realize that you can almost completely avoid JavaScript, but the point I’m making is merely that there is a real technical limitation that limits the choices developers can make for front-end code, and although WASM is making great strides in breaking down that barrier (something I’ve been thrilled to see happen, but which is going much more slowly than I had hoped), the limitation is still there. Conversely, such a barrier has never existed on the backend, except in the sense that C limits what all other languages can do.

                • @lseif@sopuli.xyz
                  link
                  fedilink
                  111 months ago

                  my point is that languages have their places.

                  javascript is great for the frontend. not just because it’s the only choice, but it’s also a lot easier to write code for ui than say, C or rust.

                  however i do not see a reason why it needs to run on servers or desktop apps, bar a few cases. i know node is popular, but i think fullstack devs just like to have everything in the same language, even if it makes it harder to use and slower to run.

                  likewise C, rust, go, whatever, are great for backends, embedded etc, but they shouldnt be ran on in the browser, unless there is a specific reason like heavy computation with little dom interaction.

                  just because a barrier does not exist doesnt mean that we should write programs in a language not designed for the domain.

    • @BatmanAoD@programming.dev
      link
      fedilink
      9
      edit-2
      11 months ago

      Well, except “robust”, unless you have very strict code standards, review processes, and static analysis.

      (And arguably it’s never elegant, though that’s almost purely a matter of taste.)

        • @BatmanAoD@programming.dev
          link
          fedilink
          7
          edit-2
          11 months ago

          I see where you’re coming from, but no matter how many null pointer exceptions there are in Java code, you’re almost always protected from actually wrecking your system in an unrecoverable way; usually the program will just crash, and even provide a relatively helpful error message. The JVM is effectively a safety net, albeit an imperfect one. Whereas in C++, the closest thing you have to a safety net, i.e. something to guarantee that invalid memory usage crashes your program rather than corrupting its own or another process’s memory, is segfaults, which are merely a nicety provided by common hardware, not required by the language or provided by the compiler. Even then, with modern compiler implementations, undefined behavior can cause an effectively unlimited amount of “bad stuff” even on hardware that supports segfaults.

          Additionally, most languages with managed runtimes that existed when Java was introduced didn’t actually have a static type system. In particular, Perl was very popular, and its type system is…uh…well, let’s just say it gives JavaScript some serious competition.

          That said, despite this grain of truth in the statement, I think the perception that Java is comparatively robust is primarily due to Java’s intense marketing (particularly in its early years), which strongly pushed the idea that Java is an “enterprise” language, whatever that means.

  • pelya
    link
    fedilink
    4911 months ago

    C++ is OVERWHELMINGLY SUPERIOR, if you ask any professional C++ developer.

    • @BatmanAoD@programming.dev
      link
      fedilink
      2911 months ago

      I was a professional C++ developer for several years, and came to the conclusion that any professional C++ developers who don’t acknowledge its flaws have a form of Stockholm Syndrome.

      • @eco@lemm.ee
        link
        fedilink
        1411 months ago

        This is true of every language. If you can’t think of things you don’t like about the language you’re working in (and/or its tooling) you just don’t know the language very well or are in denial.

        • @BatmanAoD@programming.dev
          link
          fedilink
          511 months ago

          Ehhh, I mean this more strongly. I’ve never met people more in denial about language design problems than C++ adherents. (Though admittedly I haven’t spent much time talking to Lisp fans about language design.)

          • pelya
            link
            fedilink
            511 months ago

            It’s made worse by the fact C++11 made a lot of solutions for the deep problems in the language. As the C++ tradition dictates, the problems themselves are carefully preserved for backward compatibility, the solutions are like a whole different language.

            And Lisp is small - the first Google result provides a Lisp interpreter in 117 lines of Python code.

            • @BatmanAoD@programming.dev
              link
              fedilink
              3
              edit-2
              11 months ago

              C++11 also introduced new problems, such as the strange interaction between brace-initialization and initializer-lists (though that was partially fixed several years later), and the fairly arcane rules around move semantics with minimal compiler support (for example, it would be great if the standard required compilers to emit an error if a moved-from object were accessed).

              I know Lisp is minimal, I’m just saying that I expect there are Lisp fans who won’t acknowledge (or would excuse) any shortcomings in the language, just as there are C++ fans who do the same for C++.

      • @douglasg14b@programming.dev
        link
        fedilink
        1
        edit-2
        11 months ago

        The ecosystem is really it, C# as a language isn’t the best, objectively Typescript is a much more developer friendly and globally type safe (at design time) language. It’s far more versatile than C# in that regard, to the point where there is almost no comparison.

        But holy hell the .Net ecosystem is light-years ahead, it’s so incredibly consistent across major versions, is extremely high quality, has consistent and well considered design advancements, and is absolutely bloody fast. Tie that in with first party frameworks that cover most of all major needs, and it all works together so smoothly, at least for web dev.