4 ms·
> 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 downs
by B1FF_PSUVM 7y ago
> 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.
- stkdump 7y agoI 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.
- greiskul 7y agoAnd looking at modern languages, I would say that C strings also lost, just latter, since none of them do strings that way anymore.
- Gibbon1 7y agoA good reason for adding a modern string type to C would be for better interop between other languages and C.