I know this is a subjective question, but I’m always curious about best-practices in coding style. ReSharper 4.5 is giving me a warning for the keyword “base” before base method calls in implementation classes, i.e.,
base.DoCommonBaseBehaviorThing();
While I appreciate the “less is better” mentality, I also have spent a lot of time debugging/maintaining highly-chained applications, and feel like it might help to know that a member call is to a base object just by looking at it. It’s simple enough to change ReSharper’s rules, of course, but what do y’all think? Should “base” be used when calling base members?
The only time you should use
base.MethodCall();is when you have an overridden method of the same name in the child class, but you actually want to call the method in the parent.For all other cases, just use
MethodCall();.Keywords like
thisandbasedo not make the code more readable and should be avoided for all cases unless they are necessary–such as in the case I described above.