On 2020-09-04 15:43, Paul Gilmartin wrote:
> I'm a PL/I novice, or less. A recent thread here moved me
> to browse the Ref., where I read that any constant used more
> than once must be declared and the identifier used instead.
> Sorta tyrannical enforcement of coding conventions. OK.
> I agree that 6.62607015e−34 shouldn't be hard-coded more
> than once. But SQRT( X**TWO + Y**TWO )? Ugh!
It makes sense to do it, but if you don't want to, don't. I've never actually
looked too much at load modules, but I vaguely remember that my teacher told me
in a grey past that the compiler never keeps more than a single copy of constants.
And I don't think that anyone in their right mind would ever use anything like
your SQRT(X**TWO + Y**TWO). We once had a contractor who would use TRUE and
FALSE rather than just '1'b and '0'b, and did his compares as
select(var_a = var_b);
when(true) ...
when(false) ...
end;
He didn't last very long!
For what it's worth Enterprise PL/I nowadays has a lot of options to potentially
enforce better coding standards, and some of them actually make a lot of sense,
but there are also some that probably are way over the top.
Robert
--
Robert AH Prins
robert(a)prino(d)org
The hitchhiking grandfather - https://prino.neocities.org/indez.html
Some REXX code for use on z/OS - https://prino.neocities.org/zOS/zOS-Tools.html
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN