I see no real difference between the following two methods of creating a setter, but was wondering if I am just naive. Is one more desirable than the other?
public void fooSetter(String bar)
{
_bar = bar;
}
public void fooSetter(String bar)
{
this._bar = bar;
}
There is no semantic difference in this case because there is no ambiguity. If, on the other hand, your instance field was also called
barthenthiswould be required to disambiguate: