• morrowind@lemmy.ml
    link
    fedilink
    arrow-up
    6
    ·
    11 months ago

    C++ and ruby are weird, especially since C is somehow considered a reliable rifle. Rust betrays it’s age

    • fckreddit@lemmy.ml
      link
      fedilink
      arrow-up
      9
      arrow-down
      2
      ·
      11 months ago

      C is reliable in the sense that your C program reliably has memory leaks and security holes.

        • PaX [comrade/them, they/them]@hexbear.net
          link
          fedilink
          English
          arrow-up
          0
          ·
          edit-2
          11 months ago

          Programmers can trust language security features too much…

          Of course, they’re nice to have and really can make things easier to implement securely but it’s still very easy to introduce security problems or bugs into any code. This is just an unsolvable problem of writing imperative code. All imperative code will reliably have memory leaks (even in Java!) and security holes because no compiler can check to see if you thought of everything.

          And large and complex compilers/interpreters with these security features can end up introducing their own security problems or bugs in the process of implementing them.

          I’m just tired of people entirely dismissing languages like C because they don’t have these features. Especially when the operating systems their code runs on and their languages may even be implemented in C!

          • space_comrade [he/him]@hexbear.net
            link
            fedilink
            English
            arrow-up
            2
            ·
            edit-2
            11 months ago

            because no compiler can check to see if you thought of everything.

            We can try to get closer to that with better language design. You’ll never get there but I think there are obvious benefits as to why you’d want to do that.

            I write way less bugs in Rust than I have in Java or C++, and that’s mostly thanks to the language design.

            I’m just tired of people entirely dismissing languages like C because they don’t have these features. Especially when the operating systems their code runs on and their languages may even be implemented in C!

            Because that code has been review and re-reviewed and patched by experts in the field for years. You’re not gonna write a backend for an app with short deadlines in C because that would be absolutely fucking insane.

          • frezik@midwest.social
            link
            fedilink
            arrow-up
            1
            ·
            edit-2
            11 months ago

            Buffer overflows were last seen on the OWASP top 10 list in 2004. Favoring of anything else over C for most things is a pretty obvious reason why. A language change destroyed an entire class of bugs.

    • Pipoca@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      11 months ago

      The old joke is that C++ is an octopus made by nailing legs to a dog.

      So it should probably be a rifle-chaku made by connecting two Garands with a chain.

      C# vs Java is also really weird since C# started out as basically a Java clone.

    • sexual_tomato@lemmy.dbzer0.com
      link
      fedilink
      arrow-up
      2
      ·
      11 months ago

      I watched Jon Gjenset’s stream where he implemented the beginnings of a BitTorrent client in Rust and of the four hours about 25% of it was spent wrestling with quirks in serde and reqwest.

      It was pretty discouraging watching a pro have to fight the ecosystem so hard.

      • space_comrade [he/him]@hexbear.net
        link
        fedilink
        English
        arrow-up
        1
        ·
        11 months ago

        How long ago was this? I think the ecosystem got waaay better in the last 1-2 years. 3-4 years ago it was rough but shit still worked with a bit of trouble.

    • Jesus_666@feddit.de
      link
      fedilink
      arrow-up
      1
      ·
      11 months ago

      As does C#. The Windows-specific parts are not the parts most developers will use these days.