How about:

 if fx then  do
        ntim=ntim+1
    end
else  do
   nres=nres+1
    end

Roger W. Suhr

[email protected]

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of
Clark Morris
Sent: Friday, June 18, 2021 7:19 PM
To: [email protected]
Subject: Re: EXTERNAL: Coding for the future

[Default] On 18 Jun 2021 08:57:44 -0700, in bit.listserv.ibm-main
[email protected] (Bob Bridges) wrote:

>Ack!  To my mind
>
>  if fx then
>    do
>      ntim=ntim+1
>    end
>  else
>    do
>      nres=nres+1
>    end
>
>...is much harder to read than
>
>  if fx then ntim=ntim+1
>        else nres=nres+1

As a retired COBOL programmer used to meaningful data names I have found one
condition of a compound conditional or 1 verb per line made things easier to
modify and also to read.  I tried to keep data names to 15 bytes or fewer
and didn't use qualification as much as I would have liked because of
COBOL's verbose way of handling it.


Clark Morris 
>
>---
>Bob Bridges, [email protected], cell 336 382-7313
>
>/* -from _The Voyage of the Dawn Treader_ by C S Lewis:
>Eustace: In our world a star is a huge ball of flaming gas.
>Ramandu: Even in your world, my son, that is not what a star is but 
>only what it is made of. */
>
>-----Original Message-----
>From: IBM Mainframe Discussion List <[email protected]> On 
>Behalf Of Crawford, Robert C.
>Sent: Wednesday, June 16, 2021 09:23
>
>It's a small thing, but I now longer try to cram as much code into line 
>as I can.  Now I put spaces between operators and variables and after 
>commas.  I also put the clauses following "THEN" and "ELSE" on another
line.
>
>Oh, and I used to this:
>LOOP      MVC   HERE,THERE
>
>And now do this:
>LOOP      DS       0H
>                MVC   HERE,THERE
>
>----------------------------------------------------------------------
>For IBM-MAIN subscribe / signoff / archive access instructions, send 
>email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions, send email
to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to