I can't speak for Phil, but IMHO it was a dangerous and unnecessary conflation 
of a language with its implementation. Proper design would have made a string a 
first class data type, made a varying string a first class data type, and left 
the encoding up to the compiler.

An new generation compiler, written for machines with less expensive memory, 
could easily expanded the size of the descriptors without invalidating existing 
source code.

Keep in mind that at the time K&R inflicted C on us, the world of 
communications was full of serial devices that required appropriate filler 
characters, and null was what was used for the purpose. Excluding 00 from the 
set of valid characters was shortsighted at best.

Please don't make statements about who felt what; at best you're projecting the 
attitudes of a handful of colleauges unto the rest of us; at worst you're 
making it up out of the whole cloth.

Shmuel (Seymour J.) Metz

From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> on behalf of 
Paul Gilmartin <0000000433f07816-dmarc-requ...@listserv.ua.edu>
Sent: Monday, February 10, 2020 2:29 PM
Subject: "It's about nothing" (was: UTF16 ...)

On Sun, 9 Feb 2020 15:16:13 -0500, Phil Smith III wrote:
>On my list of "things to do when I finish the time machine": No ASCII/EBCDIC 
>divide; no null-terminated strings. And something else, I forget what right 
>now. I have time, I can always do it last week.
You've complained about null-terminated strings before.  Why?

o Buffer overflow integrity exposures?
  Those result from careless software design; sometimes hardware.
  The IBM 1620 paper tape reader read tape until a record separator.
  Overflowing buffer.  Wrapping memory,  Repeatedly.  PDP-8
  read just one frame per instruction.

o Performance of strlen(), strcat(), etc.?  Dinosaurs felt betrayed
  when MVS gained UNIX Services; even more so when zSeries
  provided hardware support for null-terminated strings.

o The hole in the character set, aggravated by LF-terminated records?
  Don't conflate "string" with "array of char".

o Inability to extract a substring in-place, without copying.  PostScript's
  "substring" type provides for this nicely.  PostScript avoids null-
  terminated strings.

(Select one or more.  Specify others ad lib.)

What would you use instead, not provoking colleagues to complain
of impractically small string size limits or wastefully large

Unit records sometimes bother me;  I'd like to be able to output
before I know the length of the line, as in the Poor Man's Progress
    for I in a b c d e; do printf .; sleep 1; done; echo

-- gil

For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to