I always considered returning a null object to be bad practice for a method call that is to be responded to. Lets say
Int GetFieldByID( String IDString );
so
Int m_MyReturnedID = GetFieldByID( "myGamerTag" );
Now, I'd assume that if the ID could not be found, we might return -1 and then handle that instead of returning a null object since that might in fact mean something went wrong internally. Anyway, I was just over on the XNA developer website and was looking at this:
As you can see:
Return Value
Network gamer matching the requested ID, or null if no matching gamer was found.
Am I wrong in my preconception that returning a null object like this is bad practice? I suddenly have my doubts because I would assume that M$ developers should definitely know what they are doing for a service like XNA/Live etc, especially after various iterations.
Thanks