Quote:
Exceptions are much more deterministic than return codes. With execptions it is the same as in the military, if you dont handle it, I will tak it to your commanding officer, and up the chain of command until the president (operating system) if necessary.
The military command system is a good analogy. The way exceptions are handled are exactly you said, basically a soldier at the lowest level could potentially go all the way to the president for something trivial. And the president has no idea what's the problem is and what the soldier wants, and can only simply throw the guy out and ask him never to bother him again since the president has a lot of important things to do.
On the contrary, the return code system is much more rational. You only directly report to your direct supervisor. You never gets to the president directly. Once you report it to your direct boss your duty is done, then it is up to your supervisor to decide whether to dismiss it, handle it himself, or report one level up and let the upper level supervisor to handle it. Isn't it a better system?
Quote:
The even bigger issue occurs when a routine which can not possibly generate and error today is modified by its author so that it can generate an error (or a routine which could previously only generate error "A" can now also generate error "B").
If a function has changed its interface, then yes, it is time to go through the whole code base and exam each and every instance where it is used and make sure it still makes sense. You have to do it. And you are not allowed miss even one single spot.
A it takes to generate a computer bug is one single spot where one function is mis-used. Is that an unreasonable requirement? I don't think so.
Quote:
It is reasonible to expect EVERY client that uses this routine to be modified in a timely manner?
It definitely is! Every single client needs to use the routine MUST use it CORRECTLY. If you make 100 calls and 99 calls are correct, that is not good enough. One mis-use out of a million and it is a bug nevertheless. If you double checked every thing but still missed the bug, that is one thing. If you do not even bother to go through it even just once and let the bug slip through, that is another.
As for whether you can do it in a timely manner, it's all up to the original decision of benefit and cost of changing the function interface, and whether or not your time and budget allow you to get it done in a time frame acceptable to you.
Quote:
If you have used a routine that returns void (i.e. it can not generate an error condifiton) in a few hundred locations in a few dozen programs, would you be willing to stake any significant wager on you finding every single one of these and not missing a single one?
Is it really so hard to come up with an exhaust list where the said function is referenced? Are you willing to bet money on it being difficult? I don't think so at all. Do a global search! Better yet, change the function name slightly. So you will NOT miss a single location. If you miss, the compiler WILL remind you with an un-resolved external error. Actually I think it is a good idea to ALWAYS change the function name some what, when the interface changes. This makes sure you will go through every instance where it is referenced and make appropriate changes.