LaunchCode-Education-Archived / csharp-web-development

Unit 2 (C# Track) of the LC101 Curriculum, following fundamentals in JavaScript
https://education.launchcode.org/csharp-web-development/
GNU General Public License v3.0
5 stars 9 forks source link

Public Properties vs Public Fields #76

Closed scottkuhl closed 3 years ago

scottkuhl commented 4 years ago

I get this question from students a lot: Why would I use an auto-implemented property instead of just making a field public?

This change is my first attempt at explaining it without going into too much detail about how the compiler works and things like reflection.