4 ms·
I think a lot (not all) of people will use C and C++ because they need good performance, compile time checks, portability across OS/CPU architectures and reason
by dmz73 5y ago
I think a lot (not all) of people will use C and C++ because they need good performance, compile time checks, portability across OS/CPU architectures and reasonable memory usage.
Most of the people who use C and C++ are average programmers who think their programs will do exactly what they wrote in the source code.
The issue is that optimizations are required to get expected performance but some optimizations will result in programs not doing what user specified in the source code.
Compiler should offer a clear split between "safe" optimizations that will not change what source code says and "unsafe" optimizations that will do their best to create fastest code.
I don't use C or C++ very often and I don't know how optimizations are currently structured but if a lot of people are constantly caught unaware of what optimizations are in use and how they affect the output then this is obviously either a documentation issue or compiler interface issue - both of these are up to compiler writers to fix.
- rowanG077 5y agoWhat the source code says it does is exactly specced in the language standard. If the compiler changes this then that's a compiler bug. What you really meant to say is what people assume source code does, not what it says it does.
- josephcsible 5y agoDistinguish programs not doing what the user specified in the source code from programs not doing what the user incorrectly thought they specified in the source code.
- benibela 5y agoI have always used Pascal for those reasons, and fast compilation speed FreePascal only does safe optimizations. (unless it has bugs where it does work at all)