I\'m making a game using XNA framework, so I use a lot functions that operate on vectors. (especially Vector2 (64bit struct)). What bothers me is that most of the methods ar
Vector2 is a struct, which means that when it's returned as a value a copy is returned, rather than returning a reference to an existing structure. By using ref/out parameters you can avoid this copy so that the Vector created in the Min method is the exact vector in your result
variable.
It's one of those micro optimization that normally would be discouraged, but in the game world it's done often enough, and in environments where performance matters enough, that it's worth the slightly less readable option.
Another difference on top of the performance efficience mentioned by Servy is the ability to have multiple "return" values: instead of returning them the usual way, you list them as ref/var parameters.