title: When should I use a ThrowHelper method instead of throwing directly?
body: <p>When is it appropriate to use a <em>ThrowHelper</em> method instead of throwing directly?</p>
  
  <pre><code>void MyMethod() {
      ...
      //throw new ArgumentNullException("paramName");
      ThrowArgumentNullException("paramName");
      ...
  }
  void ThrowArgumentNullException(string paramName) {
      throw new ArgumentNullException(paramName);
  }
  </code></pre>
  
  <p>I've read that calling a <em>ThrowHelper</em> method (a method with the only purpouse of throwing an exception) instead of throwing directly <em>should</em> yield smaller bytecode. </p>
  
  <p>This, and the obvious encapsulation (another layer of indirection), may be good reasons to not throw directly, at least in some scenarios. </p>
  
  <p>Anyway, IMO the drawbacks are not insubstantial too.  </p>
  
  <ul>
  <li>A part of the (<em>exceptional</em>) control flow is hidden</li>
  <li>Exceptions end up having a more cryptic stacktrace</li>
  <li>the compiler (2.0) will not recognize that <em>ThrowHelper</em> calls are exit points from a method, hence some code-around is necessary.</li>
  </ul>
  
  <p>My limited experience is that often the overall design gets worse.</p>
  
  <pre><code>int MyMethod(int i) {
      switch (i) {
          case 1:
              return 1;
          default:
              ThrowMyException();
      }
      return 0; // Unreachable (but needed) code
   }
  </code></pre>
  
  <p>This may partly be a matter of personal taste. Anyway what are your personal guidelines about this issue? Do you find it is a good idea to use <em>ThrowHelpers</em> for all those common tasks like method param validation (<em>ThrowArgumentNullException(paramName)</em> and such)?
  Am I missing something obvious on this issue?</p>
  
  <p>Btw I'm trying not to mix this issue with the <em>validation issue</em>, e.g. a method like:  </p>
  
  <pre><code>ThrowIfNameIsNullOrEmpty(name);
  </code></pre>