3 ms·
If the entirety of C is in your head, would you take a challenge to list every operation that has undefined or implementation-defined behaviour?
by chousuke 5y ago
If the entirety of C is in your head, would you take a challenge to list every operation that has undefined or implementation-defined behaviour?
- masklinn 5y agoIt seems like it would be easier to lists those which don’t, and that would be a pretty small list.
- serial_dev 5y agoIf I were to write C, I'd probably come up with my list of "The bad parts" (like the js book), and not use those (and agree with my team not to use those). Like in JavaScript, you can understand and remember how double equals work, if you try hard enough... Or you can just decide to always use triple equals and voila, your problem is solved once and forever. But I don't write C, so take this with a grain of salt.
- adrianN 5y agoIf it were easy to avoid "the bad parts" of C, there would be a lot fewer exploits based on memory corruption. Many of the bad parts are unfortunately integral to the language. Only the strictest coding standards have a chance to avoid all the bad parts, but it's not generally possible to automatically check for compliance with all rules of, e.g. MISRA, so you still have fallible humans in the loop.
- jerf 5y agoI would assume you would claim you have English "in your head"... can you name every word in the top 5,000 words that has a "z" in it? If English is not your first language, than convert to an appropriate challenge in your native language. We aren't computers, and that's not what we mean by having things in our head.
- mannykannot 5y agoA typo involving 'z' within an English word very rarely has any significant consequences.
- MauranKilom 5y agoFirst random example that comes to my mind: "The patient needs more dozing/dosing."
- mannykannot 5y agoHa! Never say 'never'.