in reply to Over Programming

I don't like the 'it seems to work' school of program analysis, unless it is backed up by a (by definition) complete set of regression tests.

There is such a thing as defensive coding.

i.e. Parsing a config file.

while( <FILE> ) { s/#.*$//; # Lose comments s/^\s*//; # Lose leading w/s s/\s*$//; # Lose trailing w/s next unless $_; ... do stuff }
This will function fine (modulo bugs...the above is just typed). It will continue to function fine if you remove the w/s stripping lines and the set of test data doesn't contain any lines consisting of only w/s.

However, if you do that and then someone adds a line containing w/s to the config file then it will barf. Of course, if your environment defines that failure in that case is acceptable since that is not a legal line in the config file then you have done nothing wrong.

IMHO, a (small, controllable) bit of over-engineering is OK, if done sensibly.

Then again, there are always cases where this would be the wrong thing to do. So shucks, its not a universal rule.