title: Why use TimeSpan.CompareTo() rather than < > or =
body: <p>I've been going over some Microsoft samples of code for the Kinect sensor and have stumbled across the following line.</p>
  
  <pre><code>TimeSpan zeroDuration = TimeSpan.FromSeconds(0.0);
  TimeSpan timeRemaining = ...;
  
  if (timeRemaining.CompareTo(this.zeroDuration) &gt; 0)
  {
  }
  </code></pre>
  
  <p>I understand how <code>CompareTo()</code> is useful in scenarios such as sorting but why would it be used in a conditional <code>if()</code> instead of the more direct approach?</p>
  
  <pre><code>if (timeRemaining &gt; this.zeroDuration)
  {
  }
  </code></pre>
  
  <p>PS: I would take it with a grain of salt if it was from any other source but given the general quality of the code assume there is a reason</p>