The advantage of using generics is that it increases the type safety - you can only put in the correct type of thing, and you get out the correct type without requiring a ca
If you need to store arbitrary data, use List
(or whatever). Then it's absolutely clear that it's deliberately arbitrary.
Other than that, I wouldn't use the non-generic collections for anything. I have used IEnumerable
and IList
when I've been converting an object
reference and didn't know the type to cast it to at compile-time - so non-generic interfaces are useful sometimes... but not the non-generic classes themselves.