News for hackers. Stuff that matters.
Re:Best aspects of C by mrkeen on Tuesday November 17, 2020 @02:45PM (#25128670)
> The underlying cause is zero-terminated strings (instead of using start/end pairs or start/length pairs).

What type (and how big) should length be?

Re:Best aspects of C by masklinn on Tuesday November 17, 2020 @02:50PM (#25128737)
> What type (and how big) should length be?

size_t.

Re:Best aspects of C by mikepurvis on Tuesday November 17, 2020 @02:49PM (#25128726)
Probably something like how msgpack (or even variable length unicode encoding) works, where the low 127 bytes is a single uint8 char in place, and then the next 121 signals that a string of length 1-121 bytes follows, and then after that are a handful of sentinel values for "length follows and it's 1/2/4/8 bytes" plus maybe some special cases like zero-length string.

I can understand that this might have been too much implementation complexity/risk to contemplate 40 years ago, but this kind of pattern is very well established at this point, especially in scripting languages with loose typing.