nevin1@ihlpb.ATT.COM (Liber) (10/12/88)
[followups to comp.lang.misc] In article <993@esunix.UUCP> bpendlet@esunix.UUCP (Bob Pendleton) writes: >From article <634@eiger.iis.UUCP>, by prl@iis.UUCP (Peter Lamb): >> In article <978@esunix.UUCP> bpendlet@esunix.UUCP (Bob Pendleton) writes: >Run time checks aren't a general solution? Compiler generated run time checks may be general, but they aren't a solution. Not unless you plan on running a complete test suite (good luck writing one, *proving* it complete, and finding the time to run it from the beginning every time you make a code change) to make sure they aren't necessary at all. >They aren't even very expensive. But they are an expense, and, except for debugging purposes (I am assuming that we are talking about production code and not code that is being developed. If we are talking about development, then I agree that run time checks are valuable as a debugging aid, provided that they are implemented sensibly, such as dropping into a debugger when a run time check encounters an error instead of just bombing out of the whole program), are useless (sometimes even worse than useless). Also, most non-trivial programs have to have run time checks explicitly coded, anyway. And only through the explicit ones can the programmer do any kind of graceful handling. >At least not when compared to the alternative of buggy nonportable code. Since run time checks don't *fix* bugs but merely detect them (actually, the type of bugs that they detect are the ones where the specification does not match the actual code), the two choices are: 1. Buggy nonportable code 2. Buggy nonportable code with run time checks Of these two, I much prefer case 1 to case 2. I have a much better chance of terminating *gracefully* (and quite possibly even recovering) without the run time checks than with them. What is really wanted is an exception handler; run time checks don't even come close to being a substitute. -- _ __ NEVIN J. LIBER ..!att!ihlpb!nevin1 (312) 979-4751 IH 4F-410 ' ) ) "I catch him with a left hook. He eels over. It was a fluke, but there / / _ , __o ____ he was, lying on the deck, flat as a mackerel - kelpless!" / (_</_\/ <__/ / <_ As far as I know, these are NOT the opinions of AT&T.