3 ms·
...Why is the compiler reordering so much? Look. I get it, clever compilers (I guess) make everyone happy, but are absolute garbage for facilitating program un
by salawat 4y ago
...Why is the compiler reordering so much?
Look. I get it, clever compilers (I guess) make everyone happy, but are absolute garbage for facilitating program understanding.
I wonder if we are shooting ourselves in the foot with all this invisible optimization.
- saagarjha 4y agoPeople like fast code.
- knodi123 4y agoIn 2022, is there any other reasons to use C besides "fast code" or "codebase already written in C"?
- wnoise 4y ago"codebase already written in C" includes both "all the as yet unwrapped libraries" and "the OS interface".
- bluecalm 4y agoThere isn't. Fast code is pretty important though to a lot of people while security isn't (games, renderers, various solvers, simulations etc.). It's great C is available for that. If you're ok with slow use Java or whatever.
- int_19h 4y agoNo, and, in fact, the first one isn't valid - you can use C++ (or a subset of it) for the same performance profile with less footguns. So really the only time to use C is when the codebase already has it and there is a policy to stick to it even for new code, or when targeting a platform that simply doesn't have a C++ toolchain for it, which is unfortunately not uncommon in embedded.