Comment by smackeyacky
16 days ago
Zero terminated strings were the basis for an awful lot of useful software. Calling them the biggest mistake in computing is a bit OTT.
I haven’t programmed anything Pascal related for 30+ years but I dimly remember thinking at the time that I wished the string system wasn’t so hard to use.
That useful software would not have been less useful if the strings in it were represented as size + buf.
Oh really? Have you tried to rewrite anything to put your theory to the test? I don't think it's as straight forward as you think it is...
Exactly. The pascal I used had no way to dynamically allocate a string they were all fixed at compile time. That really sucked.
That argument isn’t valid. The argument would be “this string design enabled a whole lot of useful software” but that’s a different matter. (And it could very well be the case.)
Lead was the basis for an awful lot of useful gasoline. Doesn't mean it was the only solution or the best one.
A more accurate re-phrased version of the original is that they are the biggest mistake in the C language.
* https://news.ycombinator.com/item?id=1014533
zero terminated strings may cause a lot of bugs, but it also ends up in a lot of useful software, so, it;s impossible to say if its bad or not,