Hacker News new | ask | show | jobs
by croes 635 days ago
If it's not nullable and not undefined it's not empty.

If an int with 0 is empty a string with a only white spaces is the same kind of empty.

I think empty mixes the computer meaning of empty with the linguistic meaning.

1 comments

What is the computer meaning of "empty?"

I'll answer - there really isn't one. You could say "undefined" but we already have another word for that ("undefined") - an "empty" construct doesn't exist in any other programming language that I'm aware of. Back in PHP's way-too-helpful days, they came up with this concept, so they got to define what it meant. (And to be fair, as with other things from the bad old days, it has caused confusion ever since.)