I find it easier to read if END is on its own line. However, in brace languages 
like perl I like "} elsif {" on a single line.

In PL/I and REXX I eschew ELSE IF in favor of using SELECT statements.

"COMMENT bletch! TNEMMOC"

I also like labeling DO and using the name on END, ITERATE and LEAVE, although 
I wish that REXX had stuck with the PL/I use of the label instead of the 
control variable.


--
Shmuel (Seymour J.) Metz
http://mason.gmu.edu/~smetz3

________________________________________
From: IBM Mainframe Discussion List [[email protected]] on behalf of 
Paul Gilmartin [[email protected]]
Sent: Friday, June 18, 2021 12:45 PM
To: [email protected]
Subject: Re: EXTERNAL: Coding for the future

On Fri, 18 Jun 2021 16:12:13 +0000, Seymour J Metz wrote:

>I agree, although if I expect to be adding code in the future then I'll write
>
>   if fx then do
>      ntim=ntim+1
>      end
>   else do
>      nres=nres+1
>      end
>
>Note that I don't like, and don't use in REXX scripts, the C indentation 
>conventions; I indent END.
>
For me, END; ELSE DO goes om a single line.

I prefer langues such as POSIX shell with strong closure ("fi").

I try to label ITERATE, LEAVE, and END; sometimes even at the cost
of introducing an otherwise otiose control variable.

I try to code my IF; THEN; ELSE so the shorter branch
(often a termination or error EXIT or ITERATE) comes first.

JCL design made a grievous error in not requiring that label
fields of matching IF, ELSE, and ENDIF be identical.

-- gil

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