I was just wondering about your opinion on using this. Personally I prefer to omit the this operator unless really needed, but I see that some people like to use it all the time. I have once learnt to write as little code as possible, I think it makes the code easier to read.
With this:
Without this:PHP Code:
public class Form1: Form
{
private int _someInt;
private int someMethod() { ... }
private void anotherMethod()
{
this._someInt=this.someMethod();
this.DialogResult=DialogResult.OK;
}
...
}
PHP Code:public class Form1: Form
{
private int _someInt;
private int someMethod() { ... }
private void anotherMethod()
{
_someInt=someMethod();
DialogResult=DialogResult.OK;
}
...
}




Reply With Quote