"Break" and other ways out of loops and switches
mat at hou5e.UUCP
mat at hou5e.UUCP
Sun Aug 28 04:48:15 AEST 1983
If you only permit the labels for multi-level breaks to label blocks,
you have a mechanism that does away with the last excuse for using
gotos, and is much cleaner than the preprocessor kludge you advocate.
FLAME ON!
Goto's are not INHERENTLY evil (I hope MR. Djikstra is reading this!).
Goto's are bad because they require discipline in use and because more
disciplined constructs reflect well the structure of MOST problems and,
therefor, are appropriate for MOST programming. There are some problems
that are not clearly written this way. A few problems look like finite
state automata. They CAN be written as loops containing switches and
diddling with state variables. This is an unnatural solution, however,
and usually error-prone. It is usually better to write the program
like the problem.
A word on program state variables: FORTRAN provides the ASSIGN
statement, which is almost tailor-made to the uses of state variables. Yet
we seem to have little good use made of the ASSIGN. Why? Could it be
because state variables are a bad thing?
Mark Terribile
Duke of deNet
More information about the Comp.lang.c
mailing list