Possible Duplicate:
Use of var keyword in C#
Hi,
Just moved job and I am used to using var
a lot.
At my previous job we were doing lots of TDD and using resharper.
In this job they hate third party tools and the developers here say that it is not good to use var
all the time and it is not as efficient as explicit typing.
Some time ago I thought the same but now I have gotten so used to it, and it makes my code look neater.
I have read some posts and there seems to be confusion whether it is as efficient or not.
I read that using var
produces the same IL code. So should it not be as efficient? Somewhere else I read that even though using var
produces the same IL code it has to find out what type it is.
So what does 'inferred' really mean then?
Some clarification as to whether performance wise they are the same would be fantastic.