> We once had a contractor who would use TRUE and > FALSE rather than just '1'b and '0'b,
There's nothing wrong with declaring those constants, although it's hardly necessary. What comes next, however, is madness. > and did his compares as > select(var_a = var_b); My eyes! Make the bad man go away, Mommy! A man who would do that deserves to spend eternity debugging code written in uncommnted octal absolute. -- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List <[email protected]> on behalf of Robert Prins <[email protected]> Sent: Friday, September 4, 2020 3:06 PM To: [email protected] Subject: Re: Constant Identifiers 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://secure-web.cisco.com/1X_JcWx3JHc_f1E13nmOo7hRdXfapFch8zYtC5dIvaVynuNCS0ThDdNPDPdtzqU5cWcrChVkAyxgCG7YzR3isntCgajOtxeBDK9zCSdAH-9j0_gyra8BoJyeS-craVSBQn5RsWKXw6ckSQWV5--KrfwmzmU-iXH9TXZEi82QBFZ1lI_iVHkzdYT3jN_E6odD9dPnrzeOOjqM0tsdYa5Rt0yexkxG9AxBnKkRQzpCAfr5vLQBLxR60dzjTjcrVylcmZ-izviQWzvhzacjpI2e3U98dhWle_3a6BHlYHzjHK3nqrlitjNYb4E_Uw-Z4CBYBfEXq6Z7NTbGzPD9aLVG1Un61nGWuwtM1SQZBDO7dBP8SI6_XAzd-Yjfto9wz8zU9xn6HsROdpPtTmE08oQ9B-L4ZhSDUWAPfrGWS8WepLesSpO3OJmwYwzk60zweLRLi/https%3A%2F%2Fprino.neocities.org%2Findez.html Some REXX code for use on z/OS - https://secure-web.cisco.com/1y4-xs7x9vqO6PHbRZy5Va3a12SJA_cSVxtmOvzexoSU6lmsDKKph8_NsIkqU59BgFpg9iPwWGKjPth4jvJumM1-IjkeCqMGV4iqGea7vbs7b0KxuSCj0VMH0uinFaqmsWGdFveiEed2usKI5wfW_0KOOHCW2UC3ON3uq9QBxuE4kucTLTu0v1eyQ3kcYM5NSCNVrJNaQ4yEGDsaV9wz2uSgatths_ZUSKzXLmhqCJtqvKCBuyh6C8oBlf5oqclBxsnDAFaP-5ZPkYViww0QdME7Ofij_FH18I8RJkex2w2UyJRyEE8wgdBGEh96WjfpcFUHcavlvCGhhgVLaAkvawjS6upu03JlHU431KpBb7PpzLTL2-_Ps5dWjZGB2D8QCf3mb0VRv3uyFevPIhcY2g5xeAa-BWP9CTylqW3su9YBXFnsOFkwubBBeDwn9jnvw/https%3A%2F%2Fprino.neocities.org%2FzOS%2FzOS-Tools.html ---------------------------------------------------------------------- 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
