2 ms·
> Approximately every C program is a valid C++ program, so C++ can’t lose, especially not that badly! He doesn’t seem to be aware that The Benchmarks Game has
by pornel 5y ago
> Approximately every C program is a valid C++ program, so C++ can’t lose, especially not that badly!
He doesn’t seem to be aware that The Benchmarks Game has a moderator who requires the contest entries to be “idiomatic” for each language (details of what counts as idiomatic are of course contentious), so a C program that doesn’t use C++ features/idioms would not be accepted in the game.
- igouy 5y agoThe project CONTRIBUTING.md says — You will probably come across people saying that the programs are not idiomatic ("enough"). So read the description and write your own idiomatic program, without programming tricks. That's not the same as "requiring". More like — if you aren't going to contribute idiomatic programs then don't complain when we don't show idiomatic programs.
- igouy 5y agofwiw "… nontrivial C programs will not compile as C++ code without modification." https://en.wikipedia.org/wiki/Compatibility_of_C_and_C++ https://en.wikipedia.org/wiki/Compatibility_of_C_and_C++
- igouy 5y agoMeanwhile we can do better than "every C program is a valid C++ program, so C++ can’t lose" defensiveness. Look at the data tables published with that 2017 paper: https://sites.google.com/view/energy-efficiency-languages/re https://sites.google.com/view/energy-efficiency-languages/re... There's an order of magnitude difference between the times of the selected C and C++ programs, for one thing — regex-redux. That is enough to explain all of the difference between the C and C++ time measurements shown in "Table 4. Normalized global results". (Seems like an outlier which could have been excluded.)