title: How much more expensive is an Exception than a return value?
body: <p>Is it possible to change this code, with a return value and an exception:</p>
  
  <pre><code>public Foo Bar(Bar b)
  {
     if(b.Success)
     {
        return b;
     }
     else
     {
        throw n.Exception;
     }
  }
  </code></pre>
  
  <p>to this, which throws separate exceptions for success and failure</p>
  
  <pre><code>public Foo Bar(Bar b)
  {
     throw b.Success ? new BarException(b) : new FooException();
  }
  
  try
  {
     Bar(b)
  }
  catch(BarException bex)
  {
     return ex.Bar;
  }
  catch(FooException fex)
  {
     Console.WriteLine(fex.Message);
  }
  </code></pre>