What does this do in bash: ${pid:-}

As i understand it, this means
if pid is
a) unset, or
b) set to null
then replace with the value on the right of the minus sign--which is null

This confuses me because
a) I thought if a variable isn't set to anything it's automatically null. If not then what is an uninitiated variable set to?
b) if the variable is already set to null, then why replace it with another null?

I see this on line 74 in the file /lib/lsb/init-functions (I'm using hardy heron ubuntu)
Here's an excerpt from the file:

if [ -z "${pidfile:-}" ]; then 
    pidfile=/var/run/${1##*/}.pid 
fi 

The code is making sure that if the pid variable is unset it becomes null (or zero-length).
unset and null are different. null means that variable exists in memory and is "", unset means bash never heard of it before.

In coding, whenver you create a new variable you want to set it to a known state. In C you set a string to be zero-length, an integer to zero. This is the same idea.

Granted, null and zero-length are different, but the shell expands them the same way. So really there's no reason for the code as is. It could simply be:

if [ -z "$pidfile" ] ;then 
  # blah blah
fi

There's actually a simpler way.

pidfile=${pidfile:-/var/run/${1##*/}.pid}

ahh, I see. now it all makes sense. thnx!