If you ask if the language could be designed so that it was not needed on the call site, the answer is yes. There is no particular reason why they could not be forgotten. The compiler has all the necessary information from the metadata, so it can do the right conversion.
However, this would make these two overloads impossible:
public void DoSomething(int x); public void DoSomething(ref int x);
The compiler cannot fix this.
Although ref and out could be made optional, in this case these overloads will be allowed. And the compiler can either accept the default value (i.e. Not ref), or throw an ambiguity error and indicate which one you really need.
All that said, I like to specify ref and out on the call site. He tells me that the parameter can be changed. Having worked in Pascal for many years, where the var parameter is passed in the same way as the value parameter is passed (the syntax on the call site is the same), I prefer the specifics of C # in this regard.
source share