Possible Duplicate:
Difference between Property and Field in C#
I started a new job a couple of weeks ago using C# (something I've basically started learning -since- being there) and I've seen a couple of ways of doing things and I'm curious why (seeing as I'm leaning fresh and they've all picked up stuff over the years.)
Basically, I'm trying to figure out why:
private int i;
Is better than:
private int I {get;set;}
If the answer is (as I suspect) that extra IL is generated for calling the get/sets, then why do the autoimplemented get/sets exist at all? Why is
public int i;
Worse than:
public int I{get;set;}
More curious that anything else why I wouldn't just always use properties, or why I wouldn't avoid the autoimplemented methods like the plague, one or the other.
I know this sounded like a logical question when I thought of it, but not so much when I wrote it, so I hope it makes some kind of sense.
Thanks