Repeated instructions (was gotos)

Dave Caswell dc at gcm
Wed May 18 16:25:39 AEST 1988


In article <528 at wsccs.UUCP> terry at wsccs.UUCP (Terry Lambert)   writes
>>
>> Not true, actually.  X3J11 does not feel *compelled* to consider badly-
>> written existing code.  Sometimes it does, though; there are concessions
>> to such pragmatic issues here and there, where it doesn't do too much
>> violence to other objectives.
>
>Hmmm... this seems to lend even more creedence to the idea that what ANSI is
>doing is designing, not standardizing, when added to your prior statement.

No, the "badly written code" didn't work on many machines and therefore was
not standard anyway.  Just becuase people were doing some wierd things that
happened to work on a few different machines certainly does not mean that
practice should be standardized.

>> Remember, I do not advocate bashing code after the fact to remove gotos;
>> my experience is that well-organized code never needs them in the first
>> place, so efficiency comparisons between goto code and bashed versions of
>> it are irrelevant.
>
>Never, huh?  Are you saying that everybody who has ever used a goto in the
>first place is, in fact, writing badly organized code?  This is ridiculous.
>Am I expected to apply this to all languages?  What do I use instead of a
>branch instruction in assembly?  Repeated instructions?

I think that our companies experience is typical.  Out of the hundreds of
thousands of lines of code that have been written by more than a dozen
programmers there is only ONE goto that I know of (that person no longer
writes code for our company).  This is without any restrictions on their
use.  In other words but for one exception no one saw the need.

Remember this is comp.lang.c.  Is "repeated instructions" really the only
control flow construct you know?  If not I fail to see how relevant it is
to this discussion.  Certainly when people talk of "well orgranized" code
that is not what they are referring to.

My experience is that well orgranized code does not need any gotos; and
it does not need repeated instructions either.

-- 
Dave Caswell
Greenwich Capital Markets                      uunet!philabs!gcm!dc
If it could mean something, I wouldn't have posted about it! -- Brian Case



More information about the Comp.lang.c mailing list