A while ago DougWarner had written about getting a t-shirt that says 'Failure Is Always An Option'. I made a mental note to check up on that, and then promptly forgot about it.
But last night, I was refactoring some code and realized that there was a flip side to 'Failure Is Always An Option', which makes it very much an engineering/planning-oriented saying. The code was:
@transactions = map { `grep BATCH $_` } (@ARGV or `find $logdir -ctime -1 -regex .*log -print ` ); for (@transactions) { /$parser/ and do { summarize($1,$2,$3); next }; /.*/ and do { print }; }Engineering/planning emphasizes identifying (and within a budget trying to handle) all the cases that could occur to a given system. Naturally, some of these cases will lead to system failure, Not A Good Thing™. So you had better be aware of all the failure-causing states.
So after that 'oh, Yeah!' moment had passed, my code now reads:
@transactions = map { `grep BATCH $_` } (@ARGV or `find $logdir -ctime -1 -regex .*log -print ` ); for (@transactions) { /$parser/ and do { summarize($1,$2,$3); next }; /.*/ and do { print }; # failure is always an option }