Stop comparing programming languages

  • Python is versatile
  • JavaScript is powerful
  • Ruby is elegant
  • C is essential
  • C++
  • Java is robust
  • @DarkCloud@lemmy.world
    link
    fedilink
    0
    edit-2
    11 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.

    • xigoi
      link
      fedilink
      English
      011 months ago

      Only a part. A lot of the complexity is completely unnecessary.

    • @marcos@lemmy.world
      link
      fedilink
      011 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
      011 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

  • tiredofsametab
    link
    fedilink
    011 months ago
    • Rust has safety and efficiency close to C
    • Perl is processing most of your healthcare records
    • Ada is doing space stuff
    • Go is going places
    • @sparkle@lemm.ee
      link
      fedilink
      Cymraeg
      011 months ago

      C++ is inferior to Rust and should be used in no new projects unless it is absolutely necessary

  • @OpenStars@discuss.online
    link
    fedilink
    English
    011 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:-).

    • @psycho_driver@lemmy.world
      link
      fedilink
      011 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.

    • @whotookkarl@lemmy.world
      link
      fedilink
      011 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.

      • @OpenStars@discuss.online
        link
        fedilink
        English
        011 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
          011 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.

    • @MiltownClowns@lemmy.world
      link
      fedilink
      011 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
        011 months ago

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

  • @reillypascal@lemmy.world
    link
    fedilink
    English
    011 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

      • John Richard
        link
        fedilink
        011 months ago

        I shit on JavaScript for years… but Deno (built around Rust) is honestly one of the most pleasant tools I’ve used for development, and you get all the completion in VS Code.

    • @ChickenLadyLovesLife@lemmy.world
      link
      fedilink
      English
      011 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.

    • DacoTaco
      link
      fedilink
      011 months ago

      Writing raw byte binaries ftw!

      (Jokes aside, all programming languages have their good and bad things. Some just have more bad than good. And i say that as a C/C#/typescript/asm developer :p

    • @sparkle@lemm.ee
      link
      fedilink
      Cymraeg
      011 months ago

      Not Scala and Rust. They are my beloved, my sweethearts, my knights in shining armor.

      Ok Rust does have some major issues, but not Scala…

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

        Oof, slow compile times to target, of all things, the JVM? Implicit methods? Some(null)? Function call syntax where the difference between a tuple argument and a sequence of non-tuple arguments can be determined by whether or not there’s a space before the parentheses?

        There are definitely some major issues with Scala.

        • magic_lobster_party
          link
          fedilink
          011 months ago

          They also thought the best thing to take from Python is that version 3 should not be backwards compatible with version 2

          • @sparkle@lemm.ee
            link
            fedilink
            Cymraeg
            011 months ago

            I think that’s good when the objective is to improve the language. One key thing that holds many languages back is that they’re stuck with historical baggage, and it can be pretty difficult to replace/remove “outdated” stuff without breaking everything.

            I do not want to be stuck using Python 2, or Scala 2 (although there exist people who use Scala 2 instead of Scala 3).

        • @sparkle@lemm.ee
          link
          fedilink
          Cymraeg
          0
          edit-2
          11 months ago

          I agree that the slow compile times are pretty bad (maybe even deal-breakingly for large projects). I think it’s kind of necessary for a language with as powerful of a syntax as Scala though, it’s pretty absurd how expressive you can get. Maybe if it didn’t target the JVM, it’d be able to achieve way faster compile times – I don’t really see a point of even targeting JVM other than for library access (not to say that that isn’t a huge benefit), especially when it has relatively poor compatibility with other JVM languages and it’s nearly impossible to use for Android (don’t try this at home).

          Even more so, I think that null handling isn’t nice – I wish it were more similar to Kotlin’s. One thing I’m really confused as to why Scala didn’t go all-in on is Either/Result like in Rust. Types like that exist, but Scala seems to mostly just encourages you to use exceptions for error propogation/handling rather than returning a Monad.

          A more minor grudge I have is just the high-level primitive types in general – it’s pretty annoying not being able to specify unsigned integers or certain byte-width types by default, but if it really is an issue than it can be worked around. Also things like mutable pointers/references – I don’t actually know if you can do those in Scala… I’ve had many situations where it’d be useful to have such a thing. But that’s mostly because I was probably using Scala for things it’s not as cut out to do.

          With the tuple arguments point, I get it but I haven’t found it much of an issue. I do wish it wasn’t that way and it consistently distinguished between a tuple and an argument list though, either that or make functions take arguments without tuples like in other functional languages or CLI languages (but that’d probably screw a lot of stuff up and make compile times even LONGER). I saw someone on r/ProgrammingLanguages a while back express how their language used commas/delimiters without any brackets to express an argument list.

          I think an actually “perfect” language to me would basically just be Rust but with a bunch of the features that Scala adds – of course the significant functional aspect that Scala has (and the clearly superior lambda syntax), but also the significantly more powerful traits and OOP/OOP-like polymorphism. Scala is the only language that I can say I don’t feel anxious liberally using inheritance in, in fact I use inheritance in it constantly and I enjoy it. Scala’s “enum”/variant inheritance pattern is like Rust enums, but on crack. Obviously, Rust would never get inheritance, but I’ve found myself in multiple situations where I’m thinking “damn, it’s annoying that I have to treat <X trait> and <Y trait> as almost completely serparate”. It would especially be nice in certain situations with const generic traits that are basically variants of each other.

          Plus, I’ve always personally liked function overloading and default arguments and variadics/variadic generics and stuff, but the Rust community generally seems to be against the former 2. I just really hate there being a hundred functions, all a sea of underscores and adjectives, that are basically the same thing but take different numbers of arguments or slightly different arguments.

          The custom operators are a double-edged sword, I love them and always use them, but at the same time it can be unclear as to what they do without digging into documentation. I guess Haskell has a similar problem though, but I don’t think Scala allows you to specify operator precedence like Haskell does and it just relies on the first character’s precedence. I would still want them though.

          How it goes now, though, is I use Scala 3 for project design/prototyping, scripting, and less performance-sensitive projects, and Rust for pretty much everything else (and anything involving graphics or web). Scala has good linear algebra tooling, but honestly I’ll usually use C++ or Python for that most of the time because they have better tooling (and possibly better performance). I would say R too, but matplotlib has completely replaced it for literally everything regarding math for me.

  • Rose
    link
    fedilink
    011 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.”

  • @SatouKazuma@programming.dev
    link
    fedilink
    011 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…

    • magic_lobster_party
      link
      fedilink
      011 months ago

      I like Douglas Crockford’s talks about the “good parts” of JavaScript. They’re old and probably a bit outdated, but he explain quite well the history and why JavaScript is the way like it is.

      It clicked for me when I saw them the first time. Still hate JavaScript though.

      • wreel
        link
        fedilink
        English
        011 months ago

        What Crockford did was enable a lot of devs to realize there was a viable development platform built into the most prolific and open network client in the world. For that he should be commended but it should have never been taken as “this is a viable general purpose language”.

        • magic_lobster_party
          link
          fedilink
          011 months ago

          He also showed that JavaScript has more resemblance to functional programming languages rather than object oriented ones. If you try to treat it as an object oriented language like Java (like the seem to imply), you will have a bad time.

          This has changed with TypeScript though.

    • @MajorHavoc@programming.dev
      link
      fedilink
      011 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.

    • @repungnant_canary@lemmy.world
      link
      fedilink
      011 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.

    • @marcos@lemmy.world
      link
      fedilink
      011 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.