From: "Paul Gilmartin" <00000014e0e4a59b-dmarc-requ...@listserv.uga.edu>
Sent: Friday, February 02, 2018 2:16 AM


On 2018-02-01, at 06:55:29, Paul Raulerson wrote:

It also explains one of the reasons why strings in C are null terminated. There were two modes of thought back in those days, ‘Pascal’ strings, which have the string size encoded in a single byte at the start of the string, and ‘C’ strings, which terminate a string with a NULL.

Pascal string length was obviously limited by the max value of a byte ...

Who made that moronic "single byte" rule!?

The implementer.

o It should be two pointers, first byte and last byte + 1.

The address of the start of the string and the length are probably better.

o And having the length contiguous meant that substrings
 could not be created without copying.

Indeed.

It's startling how difficult it can be to shift paradigm
beyond "two modes of thought" and invent another.

BTW, those "'Pascal' strings" were not in Wirth's specification
of Pascal; they came later with, e.g. UCSD.


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

Reply via email to