title: 'is' versus try cast with null check
body: <p>I noticed that Resharper suggests that I turn this:</p>
  
  <pre><code>if (myObj.myProp is MyType)
  {
     ...
  }
  </code></pre>
  
  <p>into this:</p>
  
  <pre><code>var myObjRef = myObj.myProp as MyType;
  if (myObjRef != null)
  {
     ...
  }
  </code></pre>
  
  <p>Why would it suggest this change? I'm used to Resharper suggesting optimization changes and code reduction changes, but this feels like it wants to take my single statement and turn it into a two-liner.</p>
  
  <p>According to <a href="http://msdn.microsoft.com/en-us/library/scekt9xw%28v=vs.71%29.aspx">MSDN</a>:</p>
  
  <blockquote>
    <p>An <strong>is</strong> <em>expression</em> evaluates to true if both of the following conditions
    are met:</p>
    
    <p><em>expression</em> is not null. expression can be cast to <em>type</em>. That is, a
    cast expression of the form <code>(type)(expression)</code> will complete without
    throwing an exception.</p>
  </blockquote>
  
  <p>Am I misreading that, or doesn't <code>is</code> do the exact same checks, just in a single line without the need to explicitly create another local variable for the null check?</p>