title: Is using "out" bad practice
body: <p>I have just added an <strong>out</strong> bool parameter to a method I've written in order to get a warning in to my UI. I've used an out rather than getting the method itself to return false/true as that would imply the <em>DoSomething</em> failed/succeeded. My thinking was that the <strong>warnUser</strong> would indicate what the warning actually was without having to look at the implementation of the method.</p>
  
  <p><strong>Original Code</strong></p>
  
  <pre><code>public void DoSomething(int id, string input);
  </code></pre>
  
  <p><strong>New Code</strong></p>
  
  <pre><code>public void DoSomething(int id, string input, out bool warnUser);
  </code></pre>
  
  <p>I'm using Moq to test this code, but it doesn't support out/ref parameters because they're not supported by Lambda expressions</p>
  
  <p><strong>Test Code</strong></p>
  
  <pre><code>mockService.Verify(It.IsAny&lt;int&gt;(), It.IsAny&lt;string&gt;(), It.IsAny&lt;bool&gt;());
  </code></pre>
  
  <p>So, is using <strong>out</strong> parameters bad practise and if so what do I do instead?</p>