16 ms·
Code quality can also be judged by the quality of compiler output. C++ has many language features that allow compilers to generate efficient code. Unfortunately
by matheusmoreira 6y ago
Code quality can also be judged by the quality of compiler output. C++ has many language features that allow compilers to generate efficient code. Unfortunately it also features incredibly complex abstractions that lead to insane binary interfaces.
Binary interface complexity is actually a huge reason why people rewrite stuff in C. When you write in C, you get symbols and simple calling conventions. Makes it easy to interoperate.
- koyote 6y ago> C++ has many language features that allow compilers to generate efficient code. It does, but it also has the ability of generating inefficient code. Sure, it's often the developers fault but I feel like it's much easier to shoot yourself in the foot in terms of performance in C++ compared to other compiled languages. Some real-life examples for me: * Missing a '&' for a function parameter resulting in that object being copied for each function invocation * Adding a couple extra chars to an error message string in an inlined function which caused that function to then be 'too large' to inline according to the compiler
- Aa9C4xPz43Gg7k6 6y agoTo some degree you can write in C++ and expose C interface.