Is an argument to break, continue a bad idea?

Henry Spencer henry at utzoo.uucp
Thu May 3 06:16:50 AEST 1990


In article <2713 at mica6.UUCP> motcid!henley at uunet.uu.net writes:
>>All control structures are gotos in disguise.  The point is that more
>>constrained structures are easier for human beings to understand...
>
>Why don't you program in PASCAL if you want something simple and easy
>to read...

Mostly because I don't believe one must abandon simplicity and readability
in order to get a usable programming language.  Despite its flaws, C works
pretty well if you avoid the worst rough spots.

>Also 99% of the code I review and 100% of the code I have supported
>was available online.  If I had a problem finding a label, grep always seemed
>to work...

I've programmed using punchcards, and they work, but I feel no desire to
return to them.  The ease of finding labels is irrelevant; one should not
have to perform that particular chore at all.  Not doing something is
almost always less work than doing it, even with the best tools.  Writing
code that requires your successor to use grep to understand it is
improper and unprofessional.

>Incidentally, having written and inspected serveral K lines of code,
>I've never seen a case where a loop was used in this way and shouldn't have
>been made into a subfunction(since it provided its own functionality).

Actually, I am inclined to agree.  The original proposal strikes me as
elaborating on the wrong solution.  However, it should be cricitized on
those grounds, not on the grounds that it is somehow equivalent to goto,
which it isn't in any meaningful sense.
-- 
If OSI is the answer, what is |     Henry Spencer at U of Toronto Zoology
the question?? -Rolf Nordhagen| uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.std.c mailing list