title: Auto-implemented getters and setters vs. public fields
body: <p>I see a lot of example code for C# classes that does this:</p>
  
  <pre><code>public class Point {
      public int x { get; set; }
      public int y { get; set; }
  }
  </code></pre>
  
  <p>Or, in older code, the same with an explicit private backing value and without the new auto-implemented properties:</p>
  
  <pre><code>public class Point {
      private int _x;
      private int _y;
  
      public int x {
          get { return _x; }
          set { _x = value; }
      }
  
      public int y {
          get { return _y; }
          set { _y = value; }
      }
  }
  </code></pre>
  
  <p>My question is why. Is there any functional difference between doing the above and just making these members public fields, like below?</p>
  
  <pre><code>public class Point {
      public int x;
      public int y;
  }
  </code></pre>
  
  <p>To be clear, I understand the value of getters and setters when you need to do some translation of the underlying data. But in cases where you're just passing the values through, it seems needlessly verbose.</p>