News for hackers. Stuff that matters.
Re:Efficient string copying and concatenation in C by B1FF_PSUVM on Thursday September 12, 2019 @03:17PM (#20955255)
> null terminated strings are a joke.

There was a quiet market war some forty years ago about that, and Pascal lost.

But yeah, now we can afford it, the downsides vastly exceed the vanishing cost.

Re:Efficient string copying and concatenation in C by stkdump on Thursday September 12, 2019 @03:23PM (#20955336)
I think the problem with Pascal's strings wasn't that they stored a length. The problem was that every string variable always occupied 256 bytes of RAM and no string could ever be bigger than 255 characters.
Re:Efficient string copying and concatenation in C by sllabres on Thursday September 12, 2019 @05:37PM (#20956748)
UCSD-, TP/BP-, Freepascal?
Re:Efficient string copying and concatenation in C by sllabres on Thursday September 12, 2019 @06:41PM (#20957234)
I was in the impression that TP strings grew dynamically (memory), but I just checked for TP and this seems to be wrong. Probably too much time has passed since then ;)
Re:Efficient string copying and concatenation in C by greiskul on Thursday September 12, 2019 @05:19PM (#20956580)
And looking at modern languages, I would say that C strings also lost, just latter, since none of them do strings that way anymore.
Re:Efficient string copying and concatenation in C by Gibbon1 on Thursday September 12, 2019 @08:42PM (#20957996)
A good reason for adding a modern string type to C would be for better interop between other languages and C.