Error Handling

The Beardless Wonder rmj at tcom.stc.co.uk
Wed Oct 3 22:04:37 AEST 1990


In article <703 at VAX1.CC.UAKRON.EDU> r3jjs at VAX1.CC.UAKRON.EDU (Jeremy J Starcher) writes:
>
>I have to agree, those who flame your (or my) use of GOTOs should try to 
>program on an 8088 or a 6502 based machine in assembly.  These programmers
>know how nice GOTOs are (since often no nice alts exist).

With respect, I have spent several months now decoding and documenting a
rather large semi-differentiated lump 8086 assembler, and respectfully
submit that at least some assembler programmers wouldn't know "nice"
features of code if they came up and punched them in the face. The code
I have been facing is just barely structured (some of the time), hard to
read, badly commented and sometimes written very "creatively". GOTOs,
with one major exception, are the least of its problems.

>Although I do not feel that GOTOs should be over used.  Since C (and PASCAL)
>provide reasonable looping controls and if statements, the need for GOTOs
>declines nicely.

I concur. With that sort of looping control it is usually easy to get
some idea of where the code goes at a glance, even though its purpose
may be unclear. With the assembler I have haunting my nightmares :-), it
is usually impossible to tell where the control flow goes until after
the code is flowcharted, and even then it can give you a real headache.

I don't say that GOTOs should never be used; occasionally they are the
most appropriate thing. Overused, they make your code very hard to read.

Rhodri
>-----------------------------------------------------------------------------
>r3jjs at vax1.cc.uakron.edu


-- 
* Windsinger                 * "But soft, what light through yonder
* rmj at islay.tcom.stc.co.uk   *      airlock breaks?"
* rmj at tcom.stc.co.uk         *    --RETURN TO THE FORBIDDEN PLANET
* rmj10 at phx.cam.ac.uk        *  You've gotta be cruel to be Khund!



More information about the Comp.lang.c mailing list