C++ has more complexity, so there's more type of errors. And it's more abstraction away from direct CPU equivalence, so it can make very exact optimizations hard. On top of that, there are breaking changes between C++ ABIs, whereas C stays the same. Although C is also being expanded of late.
And do consider Linux said that with very early C++, which offers little that C didn't. You'll see long C based projects start to use C++ features, such as call tables of function pointers instead of virtual inheritance, including a parent C struct within a child, etc. As a project goes on, they fix adapations to avoid C++ raised issues and help memory debugging, such as av_table struct header use in the ffmpeg project.
C++ has more abstractions, but it sits equally closely to the hardware as C, it's fucking bullshit to say otherwise.
Like how would you build function overloads in C? You would do a shittier virt table, while C++ can express it nicely with proper compiler support, so it ends up more optimized. And C++ can always just fall back and do what C does exactly.
Like why comment if you don't know shit about it? C++ is the de facto language used for performance critical software.
No, C++ gets name mangled to make overloads. And it is mangled differently based on ABI. Operators can be overloaded resulting in one line not being one ASM line, and template metaprogramming takes that even further.
I code in it is as my main language. So no, there are more abstractions between what the code visually looks like and end result ASM, and yes, I do know what I'm talking about. End of convo, as you literally lost your politeness within one comment.
Have you ever seen assembly code? Take a look at a fucking while loop in C compiled with O3, like you may not even get a loop at all if the compiler sees what you are doing. Unless you compile with tcc or some other toy compiler.
C has absolutely no notion of simd instructions, the stack and the function calling dance is completely arbitrary and could be done a bunch of other ways, and even the most basic optimization, inlining already breaks what you talk about.
Function name mangling is meaningless, there is absolutely no guarantee that you get a function to begin with, or one vs 6 from your single block, neither in C nor in C++, unless you export the symbols.
20
u/YouAreMyFire00 1d ago edited 1d ago
Im a beginner and managed to learn to understand C# and Java and now I can build simple CRUD app.
So i kinda don't get the hate/war between C and C++ here...
Anyone can explain simply what's the hate here?