3 ms·
I think the reference to the refactoring in Visual Studio is a bit bogus in that it doesn't really imply anything about preference, you can swap between explici
by keithnz 7y ago
I think the reference to the refactoring in Visual Studio is a bit bogus in that it doesn't really imply anything about preference, you can swap between explicit and implicit. You can even specify which preference you prefer Implicit or Explicit typing for automatic code cleanup.
I've never really struggled with this in C# where nearly everything is implicitly typed. Never been a problem in non editor code views ( like github ) either. One of the major benefits, not mentioned, is when you change the type of something it doesn't cause needless code churn.
There are only a few things where I've seen it be a problem is for new people to programming where even remembering all the basic types is still a significant cognitive load and templated types look like unholy magic. They'd struggle to know what var sum = 1 + 2 + 3 would result in and really want to know.
The other, in C#, is where you end up with a IEnumerable instead of a List. This can result in some not so nice side effects