Stop comparing programming languages

  • Python is versatile
  • JavaScript is powerful
  • Ruby is elegant
  • C is essential
  • C++
  • Java is robust
    • dohpaz42@lemmy.world
      link
      fedilink
      English
      arrow-up
      43
      arrow-down
      1
      ·
      5 months ago

      PHP is old

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

    • DacoTaco@lemmy.world
      link
      fedilink
      arrow-up
      5
      arrow-down
      2
      ·
      5 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

    • chraebsli@programming.devOP
      link
      fedilink
      arrow-up
      2
      ·
      5 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
  • Xylight@lemdro.id
    link
    fedilink
    English
    arrow-up
    77
    arrow-down
    1
    ·
    edit-2
    5 months ago
    • Python is NameError: name 'term_to_describe_python' is not defined

    • JavaScript is [object Object]

    • Ruby is TypeError: Int can't be coerced into String

    • C is segmentation fault

    • C++

    • Java is

    Exception in thread "main" java.lang.NullPointerException: Cannot read the termToDescribeJava because is null at ThrowNullExcep.main(ThrowNullExcep.java:7)
    Exec.main(ThrowNullExcep.java:7) 
    
    • CSS j ust # sucks
    • <HTML />
    • Kotlin is type inference failed. The value of the type parameter K should be mentioned in input types
    • Go is unused variable
    • Rust is Compiling term v0.1.0 (/home/james/projects/Term)
    • sus@programming.dev
      link
      fedilink
      arrow-up
      14
      ·
      edit-2
      5 months ago

      C++ is std::__cxx11::list<std::__shared_ptr<table, (__gnu_cxx::_Lock_policy)0>, std::allocator<std::__shared_ptr<table, (__gnu_cxx::_Lock_policy)0> > >::erase(std::_List_const_iterator<std::__shared_ptr<table, (__gnu_cxx::_Lock_policy)0> >) /usr/include/c++/12/bits/list.tcc:158

      • LANIK2000@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        5 months ago

        I once forgot to put curly braces around the thing I was adding into a hashmap. If I remember correctly it was like ~300 lines of error code, non of which said “Wrong shit inside the function call ma dude”.

      • LordKitsuna@lemmy.world
        link
        fedilink
        arrow-up
        5
        ·
        5 months ago

        I’ll happily download 63928 depends so long as it continues to work. And it does, unlike python projects that also download 2352 depends but in the process brick every other python program on your system

      • lastweakness@lemmy.world
        link
        fedilink
        arrow-up
        3
        ·
        5 months ago

        Crates aren’t exactly runtime dependencies, so i think that’s fine as long as the 1500+ dependencies actually help prevent reinventing the wheel 1500+ times

  • SatouKazuma@programming.dev
    link
    fedilink
    arrow-up
    69
    arrow-down
    1
    ·
    5 months ago

    Mfw Rustaceans don’t exist :(

    Also, JavaScript…why are you the way you are? Does anyone have advice for learning it so it makes sense? I can’t even get tutorial projects to run properly…

    • MajorHavoc@programming.dev
      link
      fedilink
      arrow-up
      15
      ·
      5 months ago

      The mantra that got me through JavaScript was “almost nothing we do here is able to be synchronous”.

      Everything about the language makes more sense, with that context.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      5 months ago

      Start simple.

      And that probably requires not going with a tutorial. Because the JS ecosystem scorns at “simple”. Just make some HTML scaffold and use MDN to understand the DOM.

    • repungnant_canary@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      5 months ago

      Can it even make sense tho? To me JS is an example of a not too good thing that people started too eagerly so now they’re trying to make it make sense.

  • pelya@lemmy.world
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    5 months ago

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

    • BatmanAoD@programming.dev
      link
      fedilink
      arrow-up
      21
      ·
      5 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
        arrow-up
        11
        ·
        5 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
          arrow-up
          4
          ·
          5 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@lemmy.world
            link
            fedilink
            arrow-up
            5
            ·
            5 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
              arrow-up
              2
              ·
              edit-2
              5 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++.

  • umbraroze@lemmy.world
    link
    fedilink
    arrow-up
    23
    ·
    5 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.”

      • douglasg14b@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        5 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.

  • mindbleach@sh.itjust.works
    link
    fedilink
    arrow-up
    17
    arrow-down
    1
    ·
    5 months ago

    C++ is all of those, provided you pick any 10% of it.

    You’re not supposed to cast every spell in the evil grimoire.

    • BatmanAoD@programming.dev
      link
      fedilink
      arrow-up
      8
      arrow-down
      1
      ·
      edit-2
      5 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
          arrow-up
          5
          ·
          edit-2
          5 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.

  • DarkCloud@lemmy.world
    link
    fedilink
    arrow-up
    16
    ·
    edit-2
    5 months ago

    C++ is focused on getting a strong degree of root control over the hardware of lots of systems. Which is part of why it’s difficult.

    • marcos@lemmy.world
      link
      fedilink
      arrow-up
      5
      arrow-down
      1
      ·
      5 months ago

      Sorry, Undefined Behavior Everywhere was yelling way too loud to hear you clearly.

      Were you talking about strong controlling anything with C++?

    • BatmanAoD@programming.dev
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      5 months ago

      I mean, if you’re talking about CVEs permitting attackers to get control of the hardware of lots of systems, then yes, I agree

  • reillypascal@lemmy.world
    link
    fedilink
    English
    arrow-up
    15
    ·
    5 months ago

    The only reason I use C++ is because that’s what all the main audio plugin tools use. It’s warty and annoying, although I’m confused why Java would rank higher

    • ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      5 months ago

      My main experience using C++ was because I got stuck modifying an app written with Qt Creator, an utterly insane cross-platform framework that used (still uses? I dunno, only people in Finland ever used it in the first place) C++ for the under-the-hood processing and Javascript for the UI. For good measure, the application developers had modified all the C++ stuff with macros to the point where it was barely even recognizable as C++. Fortunately, it mattered not at all because the app’s customers were ISPs who just wanted a Skype clone so they could say they had one even though none of their customers ever used the damn thing.

  • OpenStars@discuss.online
    link
    fedilink
    English
    arrow-up
    11
    ·
    5 months ago

    What is C essential for anymore these days? Genuine question btw.

    I thought C++ was essential for microprocessor control, but that it depends and sometimes I gather people use C instead, but not always.

    Use the language that the company hires you to know:-).

    • whotookkarl@lemmy.world
      link
      fedilink
      arrow-up
      14
      ·
      5 months ago

      Pretty much all of the command line coreutils programs I use daily are in C; cd, ls, pwd, touch, rm, etc. If I want to write some small utility I’ll usually reach for a scripting language first like bash python ruby etc, but if it needs to be small and fast I’ll use C instead.

      • BatmanAoD@programming.dev
        link
        fedilink
        arrow-up
        2
        ·
        5 months ago

        Genuine question: if you’re writing a new CLI utility, why not Rust? This is arguably where Rust has most excelled, most famously with ripgrep.

    • MiltownClowns@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      5 months ago

      Used to be embedded systems mostly. Microwaves and the like. Although with the advance of the smart home I don’t know I’d that’s still true.

      • odium@programming.dev
        link
        fedilink
        arrow-up
        3
        ·
        5 months ago

        The majority of microwaves, fridges, etc. Still don’t connect to WiFi. It’s mostly the high end ones which do.

    • psycho_driver@lemmy.world
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      5 months ago

      The thing with C is that it’s almost always going to be the fastest high-ish level language and it has an extremely stable ABI. Self contained code written 30 years ago will likely compile with only minor (and sometimes no) tweaks today. You’re lucky to go 3 years on C++ without something fairly big breaking due to changes in the underlying language and ABI.

      • OpenStars@discuss.online
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 months ago

        That’s the kind of insight I was hoping for, thanks for sharing!

        C is also just a fun language to code in. You know, aside from pointers ofc:-). Though I have never done more than dabble around personally.

      • OpenStars@discuss.online
        link
        fedilink
        English
        arrow-up
        1
        ·
        5 months ago

        It isn’t just a language, but it is a language - as it eventually gets around to saying, but it starts off by saying that it isn’t, then later corrects itself to say that it is, etc. I feel like the focus of this ignores the historical context of what C was written to be for - at the time there was like Assembly, BASIC, Fortran (?), other long-dead languages like was it A and/or A* or whatever, there was a B language too! (developed by Bell Labs, if Google can be trusted these days), etc. - and C was developed to be better than those. So saying that like it lacks type conversions is very much missing the point - those were not invented yet. A lawn mower also lacks those, but it’s okay bc it doesn’t need them:-) I am probably nit-picking far too many points, I suppose to illustrate that the style of the article became a hindrance to me to read it b/c of those reasons. But thank you for sharing regardless.

        • BatmanAoD@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          5 months ago

          I don’t really like the title either, but the article does demonstrate how unfortunate it is that we’re effectively locked in to using the ABI at some level of nearly every piece of software.

          That said, there definitely were languages with better type systems prior to the invention of C. Pascal is a frequently-cited example.