From the point of view of simple use, I see that fields and auto-properties are functionally identical.
I am aware of one case when they differ significantly: if you set the property in the dll for the library and use different code using this DLL, then (I believe?) You can change the implementation of the property, recompile the dll and replace the file, and the call code does not need to recompile.
If what you set was a field, then change the "override" this field, because something more complex would require the calling code to be informed of the change in some way.
Another place where I repeatedly encounter differences between fields and properties is in reflection-based libraries. For example. CsvHelper or ServiceStack.Text, both of which will provide “ready-made” Serializations, but which will only consider properties and not fields (as I just spent 2 hours realizing: a sad face :). I think in the past I had similar things with AutoMapper? This seems relatively common.
It seems to me that I should allow NEVER to use the field; that Properties are equal in most circumstances and are VASTLY superior to others. The only drawback is about 12 characters of additional "{get; set;}" in the ads.
Someone can give counter examples:
- in general, when are fields better than properties?
- , -, -?
EDIT:
, : , , , , . , , .