It's not snobbery. It's just easier to read C code than it is to read C++. Lots of stuff is obfuscated by the way that C++ is written and it's not immediately obvious how it works.
Scott Myers made his career writing entire books about gotyas. Many gotchas that should not really exist but it's not immediately obvious how to fix them without breaking backwards compatibility. And it's a design choice, an important design choice at that, to not break backwards compatibility because of how many legacy libraries were compiled twenty years ago and are still in use on various systems even though the main app might be patched frequently.
The only thing I miss when writing C code is operator overloading. Being able to a + b add two structs together when dealing with complex math types is less typing than mystruct_add(a, b). Especially when you get in to compound mathematical expressions like a (-b + sqrt(b*b - 4*a*c))/(2*a). I'm not even going to pretend to want to write that out as parametrised functions.
I've written a lot of C++ and I genuinely believe C++ is a well intentioned mistake. Between the unpredictable behaviour of what your code will turn in to, the object oriented paradigm rather than a data oriented paradigm, and maybe that stateful procedural code should be functionally designed instead. Then I can see why C++ is given a hard time.
Rust isn't necessarily a solution to those either. But Rust made everything const by default. What an absolutely giant fricken cahones decision that in itself allows for so many safety related optimisations. I haven't written much Rust, but from what I've used I like it. Even more than C.
It's not snobbery. It's just easier to read C code than it is to read C++.
This certainly doesn't match my experience. Whenever I have to study a body of C, I soon feel lost in a morass of anonymous unprotected data, a quagmire of functions with no clear calling hierarchy, an unreadable dog's breakfast of macro hell, and more. I usually characterise making mods to such code as playing football in a minefield.
I've seen some terrible C++, too, but C is worse for me.
I've seen C++ that suffers from exactly those problems too.
It's also a lot easier to hide those problems in C++, and in fact much of the achievable elegance in C++ code relies on the very same features that also tend to obfuscate problems.
-5
u/SlothsUnite Jul 13 '22
If they would switch to Rust, they would bitch about freedom they lost by dumbing things down.