>>Wouldn't this do the same job? :
Public Function EmptyDate(ByVal tdDate As Object) As Boolean
>> If tdDate Is DBNull.Value Then Return True
>> Return CType(tdDate, Date) = New Date(1899, 12, 30)
>> End Function
>
>Yes, it would. But, good practice I am using is to:
>
>Not have a return to calculate something
>Not put everything into on line (this breaks on evolving when time comes and makes it extremely difficult to understand)
>
>I also need to keep multiple backend supports.
I think it's just a matter of preference. I'd find my code more readable than yours :-}
FWIW, here's what 'Code Complete' says on the subject:
(a) Minimize the number of returns in each routine. It's harder to understand a routine if, reading it at the bottom, you're unaware of the possibility that it returned somewhere above.
(b) Use a return when it enhances readability. In certain routines, once you know the answer, you want to return it to the calling routine immediately. If the routine is defined in such a way that it doesn't require any cleanup, not returning immediately means that you have to write more code.
I'd argue that 'b' applies here.....