An example is maybe due here. Bad code is bad code...whether you create it
with a GO TO or a PERFORM:
PARA-A.
IF (DID-PARA-B)
STOP RUN
END-IF.
PERFORM PARA-C.
PARA-B.
SET DID-PARA-B TO TRUE.
PERFORM PARA-A.
PARA-C.
PERFORM PARA-B.
**** This example using PERFORM is just as ugly as the following example
using GO TO *****
PARA-A.
IF (DID-PARA-B)
STOP RUN
END-IF.
GO TO PARA-C.
PARA-B.
SET DID-PARA-B TO TRUE.
GO TO PARA-A.
PARA-C.
GO TO PARA-B.
Ray Shahan
Life is not a journey to the grave with the
intention of arriving safely in a pretty and
well preserved body, but rather to skid in
broadside, thoroughly used up, totally worn out,
and loudly proclaiming:
-- WOW!!! What a Ride! --
> -----Original Message-----
> From: Patrick McMahon [SMTP:[log in to unmask]]
> Sent: Friday, March 12, 2004 1:12 PM
> To: [log in to unmask]
> Subject: Re: [HP3000-L] GO TO -- scary statistics...
>
> Absolutely John, I have seen some horrific spaghetti with no GO TO's and I
> might add that I have also seen some very fine, easy to follow, code
> judiciously using the unconditional branch. Of course I've been at it for
> 40
> years so I've seen just about everything.
>
> > -----Original Message-----
> > From: John Clogg [SMTP:[log in to unmask]]
> > Sent: Friday, March 12, 2004 1:39 PM
> > To: [log in to unmask]
> > Subject: Re: [HP3000-L] GO TO -- scary statistics...
> >
> > Tracy Pierce wrote (among other things):
> > >...you can't make spaghetti code without goto.
> >
> > Oh yes you can! I have seen horribly confusing code that didn't
> (overtly)
> > use GOTOs. I say "overtly" because as I and others have pointed out,
> it's
> > possible to use a PERFORM command to accomplish a GOTO. As has also
> been
> > pointed out, the PERFORM...THRU is also an excellent tool for creating
> > spaghetti code. If GOTO-less code is written WELL, it is indeed free of
> > spaghetti and other forms of confusion, but the idea that removal of
> GOTOs
> > alone is sufficient to accomplish that is a notion with which I can't
> > agree.
> >
> > Regards,
> > John Clogg
> >
> > * To join/leave the list, search archives, change list settings, *
> > * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
>
>
> ========================================================================
> This e-mail message has been scanned for Viruses and Content and cleared
> by School Specialty's email filtering solution.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|