title: C#: Should I use out or ref to get this struct back?
body: <p>I'm not sure of the best way to ask this question, so I'll start with an example:</p>
  
  <pre><code>public static void ConvertPoint(ref Point point, View fromView, View toView) {
      //Convert Point
  }
  </code></pre>
  
  <p>This call is recursive.  You pass in a point, it converts it relative to <code>fromView</code> to be relative to <code>toView</code> (as long as one is an ancestor of the other).</p>
  
  <p>The call is recursive, converting the point one level at a time.  I know, mutable structs are bad, but the reason I'm using a mutable point is so that I only need to create a single point and pass it along the recursive call, which is why I'm using ref.  Is this the right way to go, or would it be better to use an out parameter, or simply declare the method to return a point instead?</p>
  
  <p>I'm not very familiar with how structs are handled as opposed to classes in these circumstances.  This is code being ported from Java, where point obviously had to be a class, so it made sense to use the same temporary point over and over rather than create a new point which had to be garbage collected at every call.</p>
  
  <p>This may be a confusing question, and to heap on some more confusion, while I'm at it, should I keep a temporary static <code>Point</code> instance around for quick conversions or would it be just as simple to create a new point whenever this method is called (it's called a <em>lot</em>)?</p>