5 ms·
> Writing C or C++, first and foremost, means writing code against the standard This was never true and never will be. There are tons of C and C++ code that ca
by coliveira 3y ago
> Writing C or C++, first and foremost, means writing code against the standard
This was never true and never will be. There are tons of C and C++ code that cannot be compiled in more than a few compilers. The standard is the minimum denominator, but all compilers have something beyond the standard that is used in practice. Just check the Linux code, for example.
> if you give that up it makes no sense to stick with C or C++
No, the whole point of UB is that every compiler can do what it wants in that situation. C/C++ actively embrace differences between compilers, while trying to standardize the core meaning of the language.
- weinzierl 3y agoLinux is an excellent example. There has been a fork that made it compile with the Intel compiler and if I remember correctly it was moderately faster. Of course it went nowhere. Writing standard conformant code is hard and you do it if you have a good reason to do it. A lot of software has. The Linux kernal hasn't and that is fine. If your project also doesn't have that constraint, good for you. 30 years ago you would still choose C and a particular compiler and you could get things done. Nowadays, why bother? You could choose a language that has no UB, compiles on any hardware that is reasonably common and is still performant.