There's a strong argument for having both. The argument against short-circuit 
operators is side effects.


--
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 2:20 PM
To: [email protected]
Subject: Re: EXTERNAL: Coding for the future

On Fri, 18 Jun 2021 13:44:05 -0400, Bob Bridges wrote:

>Right, I almost never use ELSE IF.  Partly, I suppose, that's a reaction
>against the folks who carefully indented:
>
>  IF X>0
>    BLAH BLAH BLAH
>  ELSE
>    IF X>10
>      BLAH BLAH BLAH
>    ELSE
>      IF X>100
>        BLAH BLAH BLAH
>      ELSE
>        IF X>100
>          BLAH BLAH BLAH
>        ELSE
>          AND SO ON.
>
For me, ELSE IF behaves as a single token.

>And of course sometimes the AND cannot work because sometimes the second
>condition cannot be evaluated unless the first is true:
>
There's a strong argument here for short-circuit evaluation, but
seldom an argument supporting the opposite convention.

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