3 ms·
The length of a string shouldn't matter to anybody.
by Retra 10y ago
The length of a string shouldn't matter to anybody.
- sidlls 10y agoReally? I can think of at least a couple of good reasons it matters (i/o related).
- Retra 10y agoWhat matters is the amount of space it takes up. What matters is the content of the string in the context of parsing it and displaying it. And in all of these scenarios -- the only relevant scenarios for using a string -- a null string and an empty string should almost always have identical behavior.
- spullara 10y agoThere is a big difference between not knowing a value and knowing the value is empty.
- Retra 10y agoThat's really up to the context of the problem, and the specific semantics of a null value. (Which is a value, and a present one at that. If you need to account for missing data, you can do that any number of ways, with sentinel values of any kind.)
- recursive 10y agoThe length of your comment is 51 characters.