Robust Programming
nob.cs.ucdavis.edu
nob.cs.ucdavis.edu
I think this is not helpful at all, probably harmful. There might be use cases for my code I did not even think about and third-party programmers should well be able to use it as they wish. And if they feel like modifying internal state (which the author deems fragile in his article) -- oh well! We are all adults here.
NB. I agree that the library he's examining is sub-par quality and is well worth a look.
Exceptions are a much better solution - I pity anyone who isn't able to use them.
-- Ayjay on Fedang #coding
Still, I'm glad not to have to worry about malloc fails, pointer craziness and array overflows anymore, for the most part =)
user_method() call_to_get_info_from_remote_system()
Just because call_to_get_info_from_remote_system fails doesn't mean you have to be done.
user_method(tries) while i < tries if call_to_get_info_from_remote_system() == FAIL # log error if check_remote_system_reachable() # fatal error be done i++
granted this makes all kinds of assumptions like you can afford to retry this operation up to N times. It also may break the rule of "Stupidity"