CBFalconer wrote:
I look on the string facility as similar to the file facility in some respects. For files, some sort of automatic initialization is needed so that reset/rewrite can function, and so that the error of reading/writing to unopened files can be detected. For strings the 'capacity' has to be initialized, and I doubt it would be much trouble to zero the length field at the same time. Note that this is much different from initializing the entire string storage.
To drag the analogy, initializing the length of a string would be comparable to resetting a file variable to an empty (internal) file, which is not done.
But perhaps more important, initializing strings (which are not declared with an explicit initial value) would be non-standard, and encouraging programmers to rely on this leads no more non-portable code. I don't think you'd like this. ;-)
Frank