R
Richard Damon
One thing you should consider is that the beginner must begin with
simple programs, not highly secured programs designed to run a simple
hex dump utility in a 100% secure environment. There is NO point in
making hexdump.c more complex than it is already.
I feel that in a beginning programming course, it is important to teach
the students "safe" techniques, and to test for the needed error
conditions. Maybe the *first* program with input they aren't made (or
taught) the needed error checks, but then the next lesson should be
giving that program input that breaks it and how to protect from it.
Maybe then they can be taught that if they KNOW that they control the
input, then they can be a bit relaxed in checking.
Note that not all errors need to be tested. For instance, in the
canonical "Hello World" program, you could add a test for error in the
output, but what would the program do, if output is broken it isn't
going to be able to output an error message. If in the presence of the
error, the program can continue and not get into more trouble, then
ignoring the error can be reasonable. But if they learn to THINK about
error conditions early, they might not forget as often when it is really
needed.