title: VB.NET, Is Object Returned by Reference from Function
body: <p>This should be a fairly common question, but I haven't found a straightforward answer anywhere.</p>
  
  <p>If I instantiate an object within a function in VB.NET and return it, does it return it by reference or by value. IE - should I be worried about performance if I write something like this:</p>
  
  <pre><code>Public Function ret_obj_func() As big_object
      Dim ret_obj As New big_obj(&lt;lots of stuff&gt;)
      Return ret_obj
  End Function
  </code></pre>
  
  <p>If I call this function from somewhere else, will it instantiate the object in the ret_obj and then create a deep copy to pass back a copy to the caller, Or will it just pass back a reference?</p>