Clarification post Brisbane ALT.NET Meeting

At the Brisbane ALT.NET meeting last night (which rocked and had code kata) we had a discussion about the Resharper guidance "Using directive is not required by the code and can be safely removed".

I was saying that I like to leave the System.Linq reference even if it is not being used. Heinrich demonstrated that if you type

from a in "astring"
select a;

resharper suggests adding the linq reference back in. But here is an example of linq code (collection extension method) for which resharper does not correctly detect the required reference:

var a = new string[] {"serfsdfas"}.Where(

In this case you have to know that the System.Linq using statement is required. That is why I like to leave it in even when it is not being used.

Prior to this I wrote the greatest and best blog post in the world, and accidently deleted it by hitting Backspace. I'll probably get over it one day. Probably not today.

 

ALT.NET


Comments are closed