[Default] On 14 Jan 2018 19:44:14 -0800, in bit.listserv.ibm-main
dcrayf...@gmail.com (David Crayford) wrote:

>On 15/01/2018 8:07 AM, Charles Mills wrote:
>> What's the problem with SIGNAL?
>>
>> (I've written a lot of Rexx, but never used SIGNAL labelname, only SIGNAL ON 
>> ... . I drank the Structured Programming Kool-Aid in the seventies.)
>
>Unfortunately, a lot of people were intoxicated by the Structured 
>Programming Kool-Aid. I've lost count of how many programs I've seen 
>over the years with horrible, deeply nested code just to avoid branching 
>to a function exit point. Take a sample of code from the golden era of 
>structured programming and there's a very good chance it will be 
>littered with the arrow anti-pattern.
>
COBOL compilers starting with OS/VS COBOL release 1.4, the 1985
standard COBOL have been optimized for structured constructs.  Finally
with Enterprise COBOL release 5.2 EXIT PERFORM, EXIT PERFORM CYCLE,
EXIT PARAGRAPH and EXIT SECTION have eliminated the need for GO TO
statement if one is willing to PERFORM a clean-up paragraph that will
exit the program, sub-program or method if a program terminating error
is found.  The reason for always using PERFORM paragraph and never
using the PERFORM para-x THRU para-y and avoiding GO TO is so that the
compiler can do code movement and generate simpler perform statements
that don't have to take into account the possibility of fall through
code.  COBOL now has 
PERFORM UNTIL condition-1
  statement-1
  statement-2
  statements-etc
END-PERFORM
so DO loops can be coded without GO TO statements.

I have found the structured methodology useful in developing programs
and the PERFORM enhancement very useful in writing clearer programs.
With code movement it has meant that when a nested IF statement got to
convoluted I could split some of the inner nesting out into a separate
paragraph with no loss of efficiency because the code would be moved
back in line.  I write this as someone who made extensive use of ALTER
switch-paragraph TO PROCEED TO desired-paragraph, GO TO
paragraph-before-switch instead of PERFORM to save memory in DOS-360
to fit into a 16K partition and wrote programs without ANY PERFORM
statements.  

Clark Morris 
  
>
>
>>
>> Charles
>>
>> -----Original Message-----
>> From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On 
>> Behalf Of Paul Gilmartin
>> Sent: Sunday, January 14, 2018 2:14 PM
>> To: IBM-MAIN@LISTSERV.UA.EDU
>> Subject: Re: curious: Popularity & use of C on z/OS.
>>
>> On Sun, 14 Jan 2018 13:40:28 -0700, Jack J. Woehr wrote:
>>
>>> On 1/14/2018 11:35 AM, Seymour J Metz wrote:
>>>> REXX doesn't have a goto
>>> Sure it does: SIGNAL
>>>
>> No.  Don't try it.  (Or am I missing some sarcasm?)
>>
>> -- gil
>>
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions, send email 
>> to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>>
>> ----------------------------------------------------------------------
>> For IBM-MAIN subscribe / signoff / archive access instructions,
>> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions,
>send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to