Alex Rivera | Logout

To Use or Not To Use the 'this' qualifier in C#

Asked 2011-05-04T14:43:16.243
11

Possible Duplicate:
When do you use the “this” keyword?

I have just started using Resharper to analyze my code and there are many things it has suggested that I do and I am really pleased with its output as it is also teaching me a few better methods for doing things.

Obviously its suggestions can be ignored and one of these I would just like to get some feedback from the community on!

I have always preferred to use the 'this' qualifier for properties that belong to the current class (i.e this.Name). No real reason - I just seemed to adopt this many moons ago.

Resharper suggests that this is redundant and maybe I should remove it.

What do you think?

Edit
Report

1 Answer

2

In this case its a preference - so you prefer to use it, tell resharper that and it will stop complaining.

answered 2011-05-04T14:46:50.453

Your Answer