• red_tomato@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    10 days ago

    The whole point of C++ is to graft Object Oriented Programming into C like some Frankenstein’s monster because OOP was the big hype.

    C++ being performant is mostly a side effect of it being based on a language created when programs were still punched into paper cards.

        • Sonnenblume@discuss.tchncs.de
          link
          fedilink
          arrow-up
          0
          ·
          9 days ago

          If you have a constant expression like 1 + 2 in your code you can evaluate it at compile time once and avoid computing it at runtime. You can do that with control flow and much more complex language constructs in C++. If you want to know more about that look into C++ template meta programming, constexpr, and constval.

            • ddplf@szmer.info
              link
              fedilink
              arrow-up
              0
              ·
              9 days ago

              C++ has pretty much no compile-time checks, while Rust’s overengineered syntax allows it’s compiler to catch vast majority of your everyday errors during compilation.

              • Mr. Satan@lemmy.zip
                link
                fedilink
                English
                arrow-up
                1
                ·
                3 days ago

                It doesn’t eliminate logic bugs. I’d argue these are way more relevant in day to day programming.