Possible Duplicate:
C# 3.0 Auto-Properties - useful or not?
My boss and I regularly argue about the benefits and disadvantages of using automatic properties.
public string Name { get; set; }
vs
private string name;
public string Name
{
get { return this.name; }
set { this.name = value; }
}
For
I am strongly in favor of using them because I have to write less code, I find it easier to understand the class when all the fields are coded that way and just saves me a lot of time in the long run (mostly because I write a bit less code each time).
Against
He argues that they break some programming principle because the fields should reflect the state of the object and by using a property instead of a field with a property to access it, I lose that information while debugging. (Boss if you read this and it's not exactly what you mean, feel free to comment ;))
What's everyone's take on this matter?
NOTE: I have looked at the duplicate and it doesn't talk about the against points which is the point of this question. It's just people saying "I love them"/"I don't care".