3 ms·
I've always found it... somewhat unfitting, I think... that this is called the "underhanded" C contest, because so many of the winners work by getting trivial t
by saulrh 3y ago
I've always found it... somewhat unfitting, I think... that this is called the "underhanded" C contest, because so many of the winners work by getting trivial type and preprocessor stuff wrong in ways that are concerningly easy for the average programmer. Like, the 2015 winner interpreting an array of n doubles as an array of 2n floats because it screwed up a typedef of float_t, or the 2008 winner reading 3 bits out of something because it left the parentheses off of a macro definition. These are core operations for using the language as intended! There's nothing fancy going on! This is code that you, yes, you, could have written following every best practice on earth. The contest is almost tailor-made to produce evidence that C should never be used for anything that requires reliability or correctness.
- lovich 3y agoJust to make sure this was something you were considering when I internet your comment. You know that the two examples you referenced are from 9 and then 16 years ago right? Is this an increasing problem or one from a previous age of software? This is a legit question. I work with managed languages for web development. I’ve only looked at c/c++/assembly in high school classes
- londons_explore 3y agoLow level languages might not be used in many applications these days, but it is still very much the core of OS's, drivers, embedded, etc. Those things are still being made today, and the impact of a security flaw sneaks in is probably bigger than a flaw in application code.
- agsnu 3y agoC++ is still widely used for applications in some industries (games, finance), although this is less true than it was a decade ago
- rcxdude 3y agoI think that is kind of the point. It's putting the 'accidents happen' aspect of C into an adversarial environment, and it turns out in a language it's easy to write bugs in it's really easy to hide deliberate bugs.