In C #, the current properties of an object are accessed through this. XYZ is considered bad style compared to just XYZ
5 answers
He is considered only bad style if he breaks your style rules. Sometimes the usage is this
necessary to qualify a member variable against a local variable:
public MyType(int arg)
{
this.arg = arg;
}
This problem can also be mitigated with style guides. For example, prefix members with "_":
public MyType(int arg)
{
_arg = arg;
}
+6
source to share