title: Does it make sense to use "as" instead of a cast even if there is no null check?
body: <p>In development blogs, online code examples and (recently) even a book, I keep stumbling about code like this:</p>
  
  <pre><code>var y = x as T;
  y.SomeMethod();
  </code></pre>
  
  <p>or, even worse:</p>
  
  <pre><code>(x as T).SomeMethod();
  </code></pre>
  
  <p>That doesn't make sense to me. If you are sure that <code>x</code> is of type <code>T</code>, you should use a direct cast: <code>(T)x</code>. If you are not sure, you can use <code>as</code> but need to check for <code>null</code> before performing some operation. All that the above code does is to turn a (useful) <code>InvalidCastException</code> into a (useless) <code>NullReferenceException</code>.</p>
  
  <p>Am I the only one who thinks that this a blatant abuse of the <code>as</code> keyword? Or did I miss something obvious and the above pattern actually makes sense?</p>