• miridius@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months ago

      Sure :)

      There are a lot of downsides of C++ compared to more modern languages that make it not a great choice if you’re starting a web browser from scratch

      1. Complexity of the language leading to increased bugs and slower development
      2. Manual memory management is error-prone and leads to issues like memory leaks or segmentation faults. Modern browsers need to handle large amounts of dynamic content, making memory management complicated
      3. C++ lacks some of the built-in safety features of more modern languages, which has led to the majority of security vulnerabilities found in major browsers. It’s so bad that Mozilla invented an entirely new programming language just to deal with this
      4. Compared to higher-level languages, C++ can be slower to develop in, which may impact the ability to quickly implement new web standards or features unless you have a massive team
      5. While C++ is cross-platform, ensuring consistent behavior across different operating systems can be more challenging than with some other languages.
      6. Newer languages often provide built-in support for concurrent programming, garbage collection, and other features useful for browser development, which C++ lacks.

      So tl;dr: a browser but in C++ will take much longer to develop, have fewer features, more bugs, less concurrency and and more security vulnerabilities

    • SorteKanin@feddit.dk
      link
      fedilink
      English
      arrow-up
      12
      arrow-down
      14
      ·
      4 months ago

      C++ is a very old, extremely complex language. There are arguably objectively better modern alternatives, such as Rust.

      • hexabs@lemmy.world
        link
        fedilink
        English
        arrow-up
        24
        ·
        4 months ago

        I agree that Rust is the way to go, but calling something “arguably” & “objectively” in the same breath is a bit of a paradox innit?

        • SorteKanin@feddit.dk
          link
          fedilink
          English
          arrow-up
          3
          arrow-down
          2
          ·
          4 months ago

          Well, it was more to recognize that there is no inherently better programming languages in theory, they all do the same stuff. And some languages are “better” at some stuff just due to the libraries available and nothing to do with the language itself. But yea I do think Rust is an objectively better language than C++.

      • phlegmy@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        14
        arrow-down
        2
        ·
        4 months ago

        Rust is great, but anybody developing something should have the ability to choose whatever programming language they prefer. If you want it made with rust, make it yourself.

        • Excrubulent@slrpnk.net
          link
          fedilink
          English
          arrow-up
          9
          arrow-down
          7
          ·
          4 months ago

          Not everyone with the knowledge to identify this mistake is in a position to personally correct it. Do you have the time and resources to personally build a browser from scratch? No? Why do you assume a random commenter does?

          It doesn’t change the fact that Rust is similarly performant and much safer and will thus be faster to develop and less bug-prone. It’s not a difficult assessment to make. If you want to explain why they’re wrong you can talk about the issue on its merits, but you didn’t choose to, presumably because you can’t.

          • blind3rdeye@lemm.ee
            link
            fedilink
            English
            arrow-up
            7
            ·
            4 months ago

            Their choice of programming language isn’t a ‘mistake’. It isn’t something that is ‘corrected’. It’s a development choice, nothing more. That’s the point. And if some ‘random commenter’ doesn’t like that choice, that’s their problem to fix - not the developers who are actually making the project.

            • Excrubulent@slrpnk.net
              link
              fedilink
              English
              arrow-up
              3
              arrow-down
              3
              ·
              edit-2
              4 months ago

              You said they “should have the ability to choose whatever programming language they prefer”. I have good news for you.

              You have correctly identified that the developers are responsible for their own decisions. They are, you will be very relieved to hear, quite free to make as many poor decisions as they will. Nobody is going to force them to stop.

              Other people are more than capable of identifying that those decisions are mistakes. Now, that could be argued with, you could explain how it’s not a mistake.

              But you haven’t. You just said they should be allowed to do it, but nobody was arguing that they needed to be stopped, just that it was a bad decision.

              Edit: this person didn’t actually say that first quote, but the line of argument proceeded from there, and they did nothing to distance themselves from that point.

          • phlegmy@sh.itjust.works
            link
            fedilink
            English
            arrow-up
            1
            ·
            4 months ago

            I just don’t think it’s fair to tell somebody with over 20 years of experience with C++ that their decision to use C++ in their next project is a ‘fail’.

            Learning a new language will probably not be faster than using one you’re already deeply familiar with.

            I’m not sure why you’re asking me about the merits of C++ over rust, that wasn’t my point. I was simply advocating for personal choice.

            Also, my first sentence was literally praising rust, but I guess I didn’t deepthroat it enough for you to notice? Presumably because you’ve taken the thought of somebody advocating for anything other than rust as a personal attack.

        • SorteKanin@feddit.dk
          link
          fedilink
          English
          arrow-up
          1
          ·
          4 months ago

          Of course, but it still makes sense to think carefully about the advantages of disadvantages of the tools you use when starting any project.