title: What is the equivalent of C#'s `default` in VB.NET?
body: <p>I'm normally at home in C#, and I'm looking at a performance issue in some VB.NET code -- I want to be able to compare something to the default value for a type (kind of like C#'s <code>default</code> keyword).</p>
  
  <pre class="lang-cs prettyprint-override"><code>public class GenericThing&lt;T1, T2&gt;
  {
      public T1 Foo( T2 id )
      {
          if( id != default(T2) ) // There doesn't appear to be an equivalent in VB.NET for this(?)
          {
              // ...
          }
      }
  }
  </code></pre>
  
  <p>I was led to believe that <code>Nothing</code> was semantically the same, yet if I do:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Public Class GenericThing(Of T1, T2)
      Public Function Foo( id As T2 ) As T1
          If id IsNot Nothing Then
              ' ...
          End If
      End Function
  End Class
  </code></pre>
  
  <p>Then when <code>T2</code> is <code>Integer</code>, and the value of <code>id</code> is <code>0</code>, the condition still passes, and the body of the <code>if</code> is evaluated. However if I do:</p>
  
  <pre class="lang-vb prettyprint-override"><code>    Public Function Bar( id As Integer ) As T1
          If id &lt;&gt; Nothing Then
              ' ...
          End If
      End Function
  </code></pre>
  
  <p>Then the condition is not met, and the body is not evaluated...</p>