title: using guidelines for generics and IDisposable
body: <p>In item 5 of More Effective C#, the following is presented:</p>
  
  <pre><code>public class EngineDriver&lt;T&gt; where T : IEngine, new()
  {
    public void GetThingsDone()
    {
      T driver = new T();
      using (driver as IDisposable)
      {
        driver.DoWork();
      }
    }
  }
  </code></pre>
  
  <p>The goal here is to properly dispose of drive, if it implements <code>IDisposable</code>. This makes sense, but how is this implementation different from the more succinct:</p>
  
  <pre><code>public class EngineDriver&lt;T&gt; where T : IEngine, new()
  {
    public void GetThingsDone()
    {
      using (T driver = new T())
      {
        driver.DoWork();
      }
    }
  }
  </code></pre>
  
  <p>Shouldn't the code above behave in exactly the same way? In fact, isn't the original code <strong>dangerous</strong> in that the lifetime of driver is beyond the using block, but driver is disposed of at the end of said block?</p>