title: Difference between Generic method with interface constraint and method with interface parameters
body: <p>Can someone explain the difference if any between</p>
  
  <pre><code>    public void SwapIfGreater&lt;T&gt;(ref T lhs, ref T rhs) where T : System.IComparable
      {
          T temp;
          if (lhs.CompareTo(rhs) &gt; 0)
          {
              temp = lhs;
              lhs = rhs;
              rhs = temp;
          }
      }
  </code></pre>
  
  <p>And</p>
  
  <pre><code>    public void SwapIfGreater(ref System.IComparable lhs, ref System.IComparable rhs)
      {
          System.IComparable temp;
          if (lhs.CompareTo(rhs) &gt; 0)
          {
              temp = lhs;
              lhs = rhs;
              rhs = temp;
          }
      }
  </code></pre>
  
  <p>It seems to me as soon as you constrain your generic method to only accept parameters that implement an interface, you might as well use parameters of type interface.</p>