← Back to context

Comment by recursive

9 years ago

An empty string has a length. That length is zero. NULL does not have a length.

The length of a string shouldn't matter to anybody.

  • Really? I can think of at least a couple of good reasons it matters (i/o related).

    • What 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.

      2 replies →