News for hackers. Stuff that matters.
Re:Using 'this' incorrectly in C# by tjalfi on Friday August 14, 2020 @11:29AM (#24159159)
> So if you're accessing a variable without [obj]. it's either a member of the current object, or it's a local variable in the current function.

It could also be a field in the parent class. Protected fields are a bad idea but I’m sure some people use them.

Re:Using 'this' incorrectly in C# by brundolf on Friday August 14, 2020 @11:54AM (#24159545)
A field in the parent class is still a member of the current object, and I'm pretty sure there's no way "this." could make a difference there, right?
Re:Using 'this' incorrectly in C# by tjalfi on Wednesday August 19, 2020 @11:24PM (#24219562)
You're correct that the presence or absence of a "this." shouldn't make a difference.

Having said that, C# also permits you to have fields with the same name in both the parent class and the current object.

This will give you a compiler warning suggesting you use the new keyword, though.