Re: IsNothing(_myVar) vs. _myVar Is Nothing



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
|
|


.



Relevant Pages

  • Re: Art,LIfe, and Pain
    ... everyone is as stupid as he is and doesn't know he takes everything Dave ... Morton in killfile but she spouts that he is a consistent ... The defenders of David "Rack Jite" Dahlman of Seabrook, ...
    (alt.support.chronic-pain)
  • Re: IE6 SP1 Not responding
    ... "Append Completion"="yes" ... consistent :-( ... Dave ... >> FWIW I do have Norton Internet Security on the machine, ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Board Buddies
    ... is on the router table when doing a pattern that requires consistent ... pressure and the work piece is too small to control by hand. ... Dave ...
    (rec.woodworking)
  • Re: Botha banned for 2 weeks
    ... Fair enough on Schalk - and consistent with the Irishman that got ... He has been lucky to get away with it for a long time Dave. ... I know it wasn't the crime of the century but strongly-built opponents shouldn't be suffering dislocated shoulders from 'clearing out'. ...
    (rec.sport.rugby.union)
  • IsNothing(_myVar) vs. _myVar Is Nothing
    ... about...which is faster to execute or are they the same: ... I find myself using #1 most frequently but for no real reason other than I ... Prev by Date: ...
    (microsoft.public.dotnet.languages.vb)

Loading