Hi Bob,

😃  I didn't look out for the indenting, sorry.  I used <tabs> on one line, but 
not on the other, but recently I started to add comments to the "END" statement 
in more complex code, to help with clarity:

if fx then  do
        ntim=ntim+1
        end    /* if fx then  do */
else  do
        nres=nres+1
        end    /* else do - if fx then  do */

In this short example this may be superfluous, but it really helps me when 
coding nested ifs and selects
I like to code like this mainly because I forget what I intended to do when I 
come back to a piece of code I wrote months ago.  So doing this will help me 
follow my thoughts at a later time.
Of course I also hope it will help someone who looks at this, when I'm not 
around.

Roger W. Suhr

[email protected]

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Bob 
Bridges
Sent: Saturday, June 19, 2021 6:12 PM
To: [email protected]
Subject: Re: EXTERNAL: Coding for the future

I can't tell whether you're joking.  Yes, putting the DO on the same line as 
the IF is (in my opinion) more readable.  But as your email came across at my 
end, the indentation is inconsistent...which maybe you did on purpose, just to 
hear my teeth grate.

---
Bob Bridges, [email protected], cell 336 382-7313

/* The fire department in Austin has a 5-minute response time.  -from Things 
I've Learned from My Children */

-----Original Message-----
From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Roger W Suhr
Sent: Friday, June 18, 2021 23:13

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

[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.

----------------------------------------------------------------------
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