I just started using Resharper. One of its features is that it suggests changes to the code based on, i suppose, good coding practices.
One of the changes it suggested is to change the variable type to var during assignment. I kept on changing and now the code has var everywhere. Somehow I get the feeling that "var" keyword makes the code a bit difficult to understand.
Is it a good coding practice to use "var" whereever possible or is it better to stick with the actual type. (except anonymous types where its required to use "var")
Thanks.
I suggest using var
when you have code like this:
var surelyAnXText = new XText(...);
where you always can tell the want type we are declaring a variable of. But not when you have something like this:
var whatIsThis = foo.Some_Method_Where_You_Cant_Tell_The_Return_Type_From_The_Name();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With