Does using 'this' everywhere break subclass overrides?
> I've had managers want developers to use this to signify calling a base class's method, which is incorrect. You should be using base.
public class MyClass : YourClass {
public void MyMethod() {
if(!base.YourMethod()) return;
}
}I advocate using base for base.
I advocate against using this, as does Visual Studio 2017 and above [1].
Which isn't correct. Lets say someone were to come in and override the base class's method, now calling this.SomeMethod() would not be the intended behavior of the original code that was improperly using "this." as "base."
I don't want "base." or "this." in my code at all unless there is some incredibly rare case that I MUST use it.