Default string initialization: NULL or Empty? [closed]

+1 for distinguishing between “empty” and NULL. I agree that “empty” should mean “valid, but blank” and “NULL” should mean “invalid.”

So I’d answer your question like this:

empty when I want a valid default value that may or may not be changed, for example, a user’s middle name.

NULL when it is an error if the ensuing code does not set the value explicitly.

Leave a Comment