Why use simple properties instead of fields in C#?
<blockquote>
  <p><strong>Possible Duplicates:</strong><br>
  <a href="http://stackoverflow.com/questions/1277572/should-i-use-public-properties-and-private-fields-or-public-fields-for-data">Should I use public properties and private fields or public fields for data?</a><br>
  <a href="http://stackoverflow.com/questions/1216958/difference-between-automatic-properties-and-public-field-in-c-3-0">Difference between Automatic Properties and public field in C# 3.0</a>  </p>
</blockquote>



<p>People seem to dogmatically insist on the use of public properties over fields but why is it so ultra-important in the case of simple properties?</p>

<p>How is  </p>

<pre><code>public int Foo { get; set; }
</code></pre>

<p>so incredibly different than</p>

<pre><code>public int Foo;
</code></pre>

<p>?</p>

<p>Off the top of my head I can think of few practical differences between the two:</p>

<ul>
<li>Accessing the member using reflection (rare, and most decent reflective algorithms will account for the difference)</li>
<li>The second entry allows you to use the field as a valid parameter for ref and out parameters, which would seem to be an advantage to using the field version</li>
<li>Fields don't work in Remoting (probably, I've never used remoting but I imagine they wouldn't)?
</ul>

<p>Other than these fairly rare cases, changing Foo to be a computed property later results in 0 lines of code changed.</p>
