3 ms·
You're talking about something that isn't related to efficiency. Copy and pasting, macros, generating code -- none of these preclude producing an efficient solu
by xyzzy_plugh 3y ago
You're talking about something that isn't related to efficiency. Copy and pasting, macros, generating code -- none of these preclude producing an efficient solution.
There is nothing in C++ that is inherently more efficient than C.
- dermesser 3y agoExcept that more efficient solutions can be implemented much more practically? Solutions that you'd need to bend over backwards for in C?
- xyzzy_plugh 3y agoWhat does that have to do with efficiency? We don't appear to be debating language ergonomics, but the notion that C is somehow inferior to C++ when it comes to performance.
- humanrebar 3y agoC++ has a lot of compile time programming features that C cannot do practically. There are sometimes alternatives to those mechanisms in C, but they rely on mangling, macros, non-portable tricks, and so on. On the topic of performance, the best counterargument to C++ from a C perspective would be that hand rolled code generation isn't all that bad in practice. It's just language theorists don't like that approach aesthetically.