Comment by ventana
1 hour ago
> C-style strings being a thing at all really hurts.
Well, C strings exist and are probably here to stay.
I believe Pascal strings, where the length is stored in the 0th character, were much worse (also, obligatory reference to Joel Spolsky's “Back to Basics” and “fucked strings” [1]).
Looks like we only got enough memory to spare to allow arbitrary length strings with arbitrary characters – that is, being able to use 2 or 4 bytes for the length of every string – in 1990s or so, when C++ strings and similar types became popular.
[1]: https://www.joelonsoftware.com/2001/12/11/back-to-basics/
No comments yet
Contribute on Hacker News ↗