Re: IsNothing(_myVar) vs. _myVar Is Nothing
- From: "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow_MVP@xxxxxxx>
- Date: Thu, 18 Aug 2005 09:09:45 -0500
Dave,
I should add, that I would attempt to be consistent with the project,
solution, team, department, & company. On whether I used (1) or (2).
For example: In new projects/solutions that I create I normally use (2).
However if I inherited a solution that used (1), I would probably continue
using (1) in that project...
FWIW: In VB 2005 (aka Whidbey, due out in Nov 2005) a new IsNot operator is
being introduced which lends itself well to the syntax of (2).
VS 2005 info:
http://lab.msdn.microsoft.com/vs2005/
IsNot operator:
http://msdn2.microsoft.com/library/t3bat82c(en-us,vs.80).aspx
Of course with (1) you can simply use "Not IsNothing(_myVar)" instead...
Hope this helps
Jay
"Dave Taylor" <no_spam_dave@xxxxxxxxxxxxxx> wrote in message
news:%23MZT1v2oFHA.1872@xxxxxxxxxxxxxxxxxxxxxxx
| This is really not very important but something that I'm just curious
| about...which is faster to execute or are they the same:
|
| (1) If IsNothing(_myVar) Then ...
|
| or
|
| (2) If _myVar Is Nothing Then ...
|
| I find myself using #1 most frequently but for no real reason other than I
| like the way it looks.
|
| -- Dave
|
|
.
- References:
- IsNothing(_myVar) vs. _myVar Is Nothing
- From: Dave Taylor
- IsNothing(_myVar) vs. _myVar Is Nothing
- Prev by Date: Re: now.ticks does not work
- Next by Date: Re: now.ticks does not work
- Previous by thread: Re: IsNothing(_myVar) vs. _myVar Is Nothing
- Next by thread: Re: Word 2000 / VB.Net Automation Help Required
- Index(es):
Relevant Pages
|
Loading