> I mean it's not as if arrays in C are bounds checked anyway, so how would that have helped implement strings any better?
I've written an awful lot of C code, and I have much experience with the D way which uses arrays instead of null termination.
When I review a section of code consisting of strlen/strcat/strcpy/etc. I routinely find bugs in it, always centered around a mistake with the 0 termination.
When the array bounds are available, the compiler can optionally insert array bounds checks.
As for getting it for free, avoiding doing the strlen()'s is a big time saver.
I've written an awful lot of C code, and I have much experience with the D way which uses arrays instead of null termination.
When I review a section of code consisting of strlen/strcat/strcpy/etc. I routinely find bugs in it, always centered around a mistake with the 0 termination.
When the array bounds are available, the compiler can optionally insert array bounds checks.
As for getting it for free, avoiding doing the strlen()'s is a big time saver.