You should also think about things like reliability, robustness and focussing on a problem. As I wrote earlier in this thread, writing robust C code is rather tedious because you'll need to prevent range & buffer overflows. This draws attention away from dealing with the actual programming problem at hand.
I don't agree, at all. The problem with C is not that you
have to do input validation, it's that the consequences of not doing it are more dire than it needs to be.
Writing in a language which does not corrupt memory and trusting the language instead of validating inputs results in code that does not
crash in the most strict meaning of word, but still
does not work and fails in almost as badly. Very typical example is some unhandled exception propagate gazillion levels and then just get good old crash (from user's viewpoint) with ten pages of cryptic exception stack trace (and in case of embedded, no way to propagate any of this to the user or developer).
Instead, if one checks the inputs and returns -1, and the caller handles this error condition, then it can (a) report the issue, (b) use some fail-safe logic.
This is a textbook example of
false sense of security. Input validation is always required and there is no silver bullet; it's hard work, because it involves
design; designing how errors are
functionally handled. Not corrupting memory is not enough.