"break" statements
Raymond D. Dunn
ray at othervax.UUCP
Fri Nov 1 00:58:49 AEST 1985
In article <258 at 3comvax.UUCP> mikes at 3comvax.UUCP (Mike Shannon) writes:
>....
> The only thing wrong with goto statements (I never use them) is
>that they make code hard to understand. There are probably rare cases
>when code is made more clear by the use of goto statements.
Please! Goto statements do not *intrinsically* make programs hard to
understand, although like all techniques, if an individual is not familiar
with their use, then to him they may appear "more difficult".
It is my experience that a programmer who does not have his logic clear can
write just as obscure code using a structured language than a "goto'ed"
language.
Specifically, the use of goto's (and especially long jumps) to cut across
normal program logic to handle exception processing, is to my mind, almost a
necessity, and *certainly* simplifies the conditional structure of a
program. This applies just as strongly to the ability to abort out of
several levels of loops. Like most programming methods, the careful
choice of label names and use of comments is the key to understandability.
Ray Dunn. ...philabs!micomvax!othervax!ray
More information about the Comp.lang.c
mailing list