Compilation Keyword Performance
Refactoring a Large Project (in terms of lines of code) I got introduced to ReSharper and the theme using var instead of a type that will only affect at compile time. Does this significantly affect compile time? I would like to define a code style for it in my company, but I'm not sure if I like the idea of "overusing" the var keyword ...
+3
source to share
2 answers
This has no effect, since var is resolved at compile time, since C # is a static language.
At compile time, the compiler replaces the actual type where var is in the code. So little impact on the compiler of compiling the code
Example:
var s = "hi";
is replaced by
string s = "hi";
+2
source to share