Computer Old Farts Forum
 help / color / mirror / Atom feed
From: Paul Winalski <paul.winalski@gmail.com>
To: coff@tuhs.org
Subject: [COFF] Re: Of PL/I
Date: Wed, 3 Apr 2024 12:18:58 -0400	[thread overview]
Message-ID: <CABH=_VSyO8tNQ8HSqEFcNHe5a6gj_rEc7MiC6v9UtLB9cKpU-Q@mail.gmail.com> (raw)
In-Reply-To: <1d3f129c-eafe-4fb2-9ea2-d949f3813c88@technologists.com>

[-- Attachment #1: Type: text/plain, Size: 2735 bytes --]

On Tue, Apr 2, 2024 at 1:01 PM Charles H Sauer (he/him) <
sauer@technologists.com> wrote:

>
> Being judicious in using just the good parts, PL/I seemed just fine.
> Essentially all of my work at Yorktown was in PL/I.
>
> Every programming language I've encountered has had its share of what I
call toxic language features--things that impair reliability and
maintainability.  Good production programming shops ban the use of these
features in their code.

In the case of PL/I, IMO the most toxic feature is the DEFAULT statement.
This is Fortran's IMPLICIT on steroids.  The end result of using the
DEFAULT statement is that, when you see a variable declaration, you need to
review all of the applicable DEFAULT statements to figure out what the
variable's attributes are.

PL/I was designed to be a successor language to both COBOL and Fortran.
One of the ugly features of Fortran is a fussy set of rules on statement
ordering, particularly on declaration-type statements.  PL/I relaxed those
rules.  Declarations can appear anywhere in the program and apply
throughout the block they appear in.  I know of folks who composed programs
at the keypunch who used to write down variable declarations on a piece of
paper as they came up with them, then when they reached the END statement
of the scope block, punched out all the cards for the DECLARE statements.
This practice was annoying in that, while reading the code you'd encounter
variables that hadn't been declared yet and you'd have to rummage through
the code to find the declarations.  In the PL/I shops I worked at it was
required that all declarations be at the beginning of the scope block.

PL/I also has very weak data typing--you can convert almost any data type
into almost any other data type.  The language has a large and baroque set
of conversion rules, and these don't always produce intuitive results,
particularly when doing fixed decimal division.  It can also mask typos,
leading to hard-to-find bugs.  I once mistyped:

IF A ^= B  [I'm using ^ here for the angle-bracket EBCDIC NOT sign
character]

as:

IF A =^  B

where A and B were both declared as character strings.  So I wrote "if A
equals NOT B".  The compiler happily generated code to treat B as a
character string of 0s and 1s, convert that to a bit string, apply the NOT
operation, then similarly convert A to a bit string and do the comparison.
This of course caused unexpected program behavior.  It might have taken me
a long time to find it except that there was a warning diagnostic message
from the compiler:  "data conversion will be done by subroutine call".
This almost always means you've unintentionally mixed data types.

-Paul W.

[-- Attachment #2: Type: text/html, Size: 3236 bytes --]

  reply	other threads:[~2024-04-03 16:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-02 15:06 [COFF] " Dave Horsfall
2024-04-02 16:40 ` [COFF] " Clem Cole
2024-04-02 17:01   ` Charles H Sauer (he/him)
2024-04-03 16:18     ` Paul Winalski [this message]
2024-04-03 17:30       ` segaloco via COFF
2024-04-03 20:44         ` Paul Winalski
2024-04-04  3:37         ` Wesley Parish
2024-04-04 15:40           ` Paul Winalski
2024-04-04 22:53           ` Peter Pentchev
2024-04-07 23:10     ` Dave Horsfall
2024-04-07 23:25       ` Charles H Sauer (he/him)
2024-04-09 21:41         ` Stuff Received
2024-04-10  0:50           ` [COFF] SNOBOL, ICEBOL, SPITBOL, et al William H. Mitchell
2024-04-10  1:42             ` [COFF] " Dave Horsfall
2024-04-08  1:13       ` [COFF] Re: Of PL/I Paul Winalski
2024-04-02 19:25   ` Stuff Received
2024-04-02 20:31     ` William H. Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CABH=_VSyO8tNQ8HSqEFcNHe5a6gj_rEc7MiC6v9UtLB9cKpU-Q@mail.gmail.com' \
    --to=paul.winalski@gmail.com \
    --cc=coff@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).