The difference is that other assemblies compiled with the code that reads the property are compiled against the property.
If you later decide that you need to add code to getter or setter, you can do this without having to recompile each assembly associated with it.
Not so with the fields. If you subsequently change the field to be a property to add this code, other assemblies associated with yours will stop functioning as they are compiled to read the field, not the property.
In addition, a lot of code is written to search for properties, not fields, such as data binding, etc.
Lasse Vågsæther Karlsen Aug 01 '09 at 16:38 2009-08-01 16:38
source share