| I think that you have the formulation backwards. You claim that people can just write better, and should attain perfection. > I don't think anyone can demonstrate that it is virtually impossible to write 100% safe C code. I think most people come at the other way. Most people are aware that they are fallible and wants tools to help with that. Most people strive for perfection and none will ever actually attain it. > I don't think anyone can demonstrate that it is virtually impossible to discover errors safely in C code. There is a huge difference simply moving from C to C++ with exceptions. The type system in C++ can detect several classes of errors at compile time and prevent then grom going into the results. Then for runtime problems if an underlying functions throws, it cannot simply be ignored. Any programmer can miss a single statement, or worse refactor a function with a void return to one that returns and error code (which then results in every caller ignoring the return value). However, it takes a special kind of malice to use something like carelessly catch(...) in C++ to disregard exceptions so that runtime errors are avoided. C++ with exceptions has more sane defaults because it fails fast and the failing itself doesn't need tests until it starts doing something meaningful. Now imagine the advances in error detection moving to languages that catch additional classes of errors. |
And a whole load of compiler warnings. Worse yet, people who ignore warnings might ignore them.
> Now imagine the advances in error detection moving to languages that catch additional classes of errors.
Languages don't catch errors, tools do. The C tooling has been and still is constantly improving.