Re:Let’s Stop Bashing C
by ArkyBeagle on Friday December 02, 2016 @07:31PM
(#13093491)
His idea of flagging UB at compile-time is pretty obvious - I have to wonder what the economics are that it hasn't been an emphasis at all, all these years.
I do get a facial tick when people say "all significant C programs use (or contain) UB." It's never been necessary and it's always been shameful.
As someone that doesn't HAVE to use C, this weirdness is one of the things that makes it interesting to me. I'm sure I'm the exception here, and if I were writing lots of C code for big projects I'd feel otherwise.
Yes, every time a C program relies on undefined behavior, it's a bug. And as djb observed, virtually all non-trivial C programs contain these bugs. This is the core of my argument.
Yes, we could rely on C programmers never making mistakes. But it would be better to design languages with no undefined behavior.