Re: C strings. In a timely event, u/skeeto just found a bug in Bash due to NUL.
The design of C strings actually admits how important it is to keep the length. You always want to know the length, and C strings "solve" that problem by appending a '\0'. That decision makes them non-recursive and from there stem all their problems. (Pascal strings suffer from this too, but atleast you can do bound checks).
View all comments
2
u/8d8n4mbo28026ulk 13d ago edited 13d ago
Re: C strings. In a timely event, u/skeeto just found a bug in Bash due to NUL.
The design of C strings actually admits how important it is to keep the length. You always want to know the length, and C strings "solve" that problem by appending a
'\0'. That decision makes them non-recursive and from there stem all their problems. (Pascal strings suffer from this too, but atleast you can do bound checks).