|
|
|
|
|
by foxfluff
1563 days ago
|
|
> However, there may still be a number of corner cases of the language like undefined behaviors. This is why people frequently fall into C's traps. I don't think that's true; the UB that is relevant for day-to-day programming is easily learned. It's just that a sucker is born every minute and there's always someone who's been taught that C is a high level assembler. Now and then someone slips a piece of code that assumes as much in a project and disproportionately big noise is made about it. Most UB-related bugs in C code are not there because the author didn't know it's UB, but because they simply coded it wrong. People fall into simple buffer overflows, double frees, etcetra all the time and no-one thought it's ok to overflow a buffer. |
|
On the other hand, I'm quite confident that I don't have much UB in my code (as running sanitizers from time to time confirms). And miraculously, I've never ever been surprised by "nasal daemons".