The biggest issue with C isn't its footguns, rather the WG14 unwillingness to provide additional language or library features that would allow for a safer C outside the low level code where it pretends to be a portable macro assembler.
The biggest issue with C isn't its footguns, rather the WG14 unwillingness to provide additional language or library features that would allow for a safer C outside the low level code where it pretends to be a portable macro assembler.
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!
It may be a good idea from a theoretical standpoint, but once you start calculating the cost it simply doesn't make sense.
Thankfully they are starting to pick up.
There's even plenty of means for backwards-compatible strings and arrays, such as sds.
But really the point was more to "this should have really been addressed decades ago."
Maybe liability and lawsuits are really needed to stop with such excuses.
Maybe it's better to just use a better tool for new code bases?