This won't compile:
using IEnumerable<T> = System.Collections.Generic.IEnumerable<T>;
namespace MyNamespace
{
public class MyClass<T> : IEnumerable<T>
{
// Appropriate stuff here
}
}
Is this by design? In other words, when using the classes and
interfaces of the System.Collections.Generic namespace, must I make an
exception to my normal coding style and change the above code to read:
using System.Collections.Generic;
namespace MyNamespace
{
public class MyClass<T> : IEnumerable<T>
{
// Appropriate stuff here
}
}
If so, then I'm kind of bummed. To make it easier for others to read
my code, I like to create using aliases for each type that I use
within a file, and to arrange the aliases alphabetically. Although
this practice seems anal, years of Java coding and reading others'
Java code made it clear to me that explicitly identifying the
namespaces (packages) of types makes it much easier for a reader to
figure out where a type is "coming from" whenever the reader
encounters a usage of a type within a file.
Thank you in advance.