4 ms·
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 a
by smackeyacky 4mo 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.
- asdfasgasdgasdg 4mo agoThat useful software would not have been less useful if the strings in it were represented as size + buf.
- crackez 4mo agoOh 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...
- smackeyacky 4mo agoExactly. The pascal I used had no way to dynamically allocate a string they were all fixed at compile time. That really sucked.
- ComputerGuru 4mo agoThat 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.)
- zzrrt 4mo agoLead was the basis for an awful lot of useful gasoline. Doesn't mean it was the only solution or the best one.
- JdeBP 4mo agoA 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=48614913 https://news.ycombinator.com/item?id=48614913 * https://news.ycombinator.com/item?id=24454369 https://news.ycombinator.com/item?id=24454369 * https://news.ycombinator.com/item?id=1014533 https://news.ycombinator.com/item?id=1014533
- saagarjha 4mo agozero 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,