Inheriting from List<T> in .NET (vb or C#)
- by Tony
I have been delved in C++ world for a while, but now I'm in .NET world again, VB and C# and I wondered if you have a class that represents a collection of something, and you want the ability to use this in a foreach loop, etc... is it better to implement IEnumerable and IEnumerator yourself or should you inherit from the List<T> where T is the object type in it's singular form?
I know in C++ for example, inheriting from a container is considered a bad idea.
But what about .NET.