Now I'm okay with this obviously. Whatever the team chooses is fine by me and once everybody agrees to use the same standards then that is the important thing.
It is interesting that Resharper highlights the redundancy of it by default Qualifier 'this.' is redundant and Stylecop warns you to include it! I find it litters up your code pretty quickly with noise.
Anyhow, I really wanted to find out the uses of the keyword that are not related to style. So here is a list of required uses (i.e. you absolutely have to use it and it is not just a style choice)
- To qualify members hidden by the same name
- To have an object pass itself as a parameter to other methods
- To have an object return itself from a method
- To declare indexers
- To declare extension methods
- To pass parameters between constructors
- To internally reassign value type (struct) value.
Some interesting links on the topic
No comments:
Post a Comment