|
|
|
|
|
by flohofwoe
1791 days ago
|
|
In the early years the job of the C committee wasn't to improve C, but merely to harmonize existing C implementations, and by the end of the 80's it was already too late, zero-terminated strings had already been baked into operating system APIs (e.g. zero-terminated strings are no longer primarily a language problem, but an ABI problem). Besides, the x86 "repeat while" string instructions continued the PDP legacy. |
|
Or like my spouse likes to joke when we get in the car to leave and forgot something in the house: "it's too late, the door's shut."
I get why null terminated strings once existed. It's baffling that they continue to exist 50 years later. Not to mention, they don't even work on data buffers, so you need fat pointers anyways!