In the thread https://www.avrfreaks.net/index.p... stevech claims that
C++ on a microprocessor = driving a car with the emergency brake on.
This has been up here on AVRfreaks several times before. Every time there seems to be a lack of substance to this claim. AFAICR I myself has posted some thoughts about the costs of vitual functions, and I seem to recall a post which talked about template classes. Apart from that the claim is made, but based on thin air.
Could stevech either remind me of threads I have forgotten about, or re-iterate the proof of the claim.
This is about the accusation that C++ by principle, and "overall" produces inefficient code as compared to C.
When the subject is up, we inevitably also end up discussing if there are any merits to using C++ v/s C. That's OK by me. I have no "religous" opinion on that matter. I would be interested in a moderated debate. (I know - there has been requests for a real-word example of C++ on AVRs. I'm working on that. Slowly. And I am not finished yet.)
If we have the latter discussion (on the merits) then please don't use this to dodge, camouflage or derail the former (about the code effectiveness of C++). They are two different discussions, as far as I am concerned. For the former we should be able to be deterministic. The latter is more about opinion, experience, religion and the phase of the moon.
I have posted several longish things on why I see no principal reasons that C++ should be less effective than solving the same problem in C. I am willing to repeat and refine such a rant if you want to.
So, with the flame throwers tucked away - let's try to establish in which situations C++ must produce less effective code than C.