Correct way to do it?

CAVESTER

Freshman
Joined
Sep 5, 2003
Messages
25
Hi all,

Quick question...

from a syntax and a programaticly correct point of view, is it better to form a construct like this...

Code:
If oDB.GetObject Is Nothing Then
     Exit Sub
End If

Continue...

or this...

Code:
If Not oDB.GetObject Is Nothing Then
     Continue...
End If

Cheers,

Lee.
 
It depends on which condition you need to handle... if you will have code in both then either one is fine, but NOT if you're going to use Exit Sub. (Don't use it)

Also, drop the o that prefixes oDB since everything in .NET is an Object.
 
Back
Top