Global variables are generaly regarded as bad coding. I'm actually looking to remove globals where possible.
And I don't think using globals will help anyway, because you would still need to do `global $userid` any time before you use it.
The good thing about using the function is that if the method of getting the user changed, you won't need to change your code.