2 ms·
> I am saying that when you assign a value to a string variable, such as during its first (and let's say 'only') initialization, it would be absolutely insane
by lmm 6y ago
> I am saying that when you assign a value to a string variable, such as during its first (and let's say 'only') initialization, it would be absolutely insane to also have to set the string's length.
You should have a constructor/factory for strings that will form/instantiate the string in a valid state, with its value matching its length. That's not the same thing as a setter that mutates the string in-place.