Topic: STL iterator -> Robust vs. Fragile
Author: "Warren F. Seltzer" <warrens.seanet.com>
Date: 1995/04/21 Raw View
Regarding the discussion of robust code vs. fragile:
I have been programming computers, on and off, since 1965. I have written
hundreds of thousands of lines of code. Three things I know:
1. Fragile code improves more quickly. Misbehavior is information, like
smoke signals from your toaster.
2. If you have to crash/coredump/GPF, then you have to crank up the debugger and
waste time. But you *will* find the bug. Better to use Assertions than
crash without comment.
3. Some forms of "Robust Code" hide bugs and make bad code look good. Very nasty.
However, Robustness with respect to outside phenomena, that is,
"Defensive Programming", makes sense. Test your code with random input, if
you can.
--
Warren F. Seltzer Just east of Seattle
warrens@warrens.seanet.com