C sharp code cleanup : resharper
- by Ankit Rathod
Hello,
I just used Resharper in one application and it made me feel as if i don't know how to code at all in C# :(. On every line it gave me it's suggestions :-
Few of Resharper's favorite suggestions are :-
1) SomObject o = new SomeObject();
Resharper will convert to :
var o = new SomeObject()
2) this.Loaded += new RoutedEventHandler(MainPage_Loaded);
to
this.Loaded += MainPage_Loaded;
3) convert my variables and putting _ in front of all instance variables.
4) Removing class parent's name. I tested this on Silverlight.
public partial class MainPage : UserControl
to
public partial class MainPage
EDIT :-
5) replace instance variable
this.variable = somevalue
to
variable = somevalue
Are all of these really necessary? Is it really going to affect the efficiency of my program? I mean what good is it going to do by replacing my class names with var keyword. After all var is also replaced with class name at compile time. Is it doing because it has been programmed to do or do these things really affect in some or another way?
Thanks in advance :)