HP3000-L Archives

March 2004, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
"Emerson, Tom" <[log in to unmask]>
Reply To:
Emerson, Tom
Date:
Thu, 11 Mar 2004 17:31:02 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (51 lines)
> -----Original Message-----
> From: John Clogg [mailto:[log in to unmask]]
> 
> Kent wrote:
> >I was told in 1986 when I worked at Boeing, never to use "GO TO"'s.
> 
> Now this is a good posting to liven up the list!  Plenty to 
> debate about, but since it doesn't involve politics or 
> religion, there will hopefully be no name-calling, etc.

oh goody! a cobol-vs-the-world flamewar :) [where'd I leave the <sarcasm/> tags?]
 
> OK, now let me weigh in on the "GO TO" question.  While I 
> agree that GO TOs are generally bad, I have seen some truly 
> awful code written in the name of avoiding them. [...]

Actually, slightly worse than "go to" (in my mind) is the cobol concept of:

   PERFORM ... THRU ...

and

   PARAGRAPH-A SECTION.
   PARAGRAPH-A-00.
      [code]
   PARAGRAPH-A-10.
      [more code]
   PARAGRAPH-A-99-EXIT.
      EXIT.

for which I'll refer you fine folks to page 219 of Tyler Welburn's STRUCTURED COBOL / fundamentals and style (the big red book I'm sure practically everyone has seen at some point in their career):

   SINGLE PARAPGRAPH MODULES
   In this text, we have been using and will continue to use single-paragraph modules
   [...] The advantages of single parahraph modules can perhaps best be identified
   by discussing the disadvantages of the alternative methods.

   MULTIPLE-PARAGRAPH MODULES
   [stuff instituted via PERFORM ... THRU ...]

   SINGLE-SECTION MODULES
   [stuff that hides the "THRU ..." part of the above]

   MULTIPLE-SECTION MODULES
   [the above, squared]

In a nutshell: with "thru ..." logic, you never know when a paragraph really ends, and will often "fall through" when you least expect it...

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2