posted 5 years ago
You mean "obsolete". That's a tough question to answer. Many APIs still work with the non-generic versions, and some have made a partial transition in that they check that a collection implements the generic version before they attempt call the non-generic methods.
I recommend that when you write methods that accept or return collections, they only accept or return the generic versions. When you write a collection type, implement BOTH the non-generic and generic versions, but give explicit method implementations for the non-generic version, so they can not be called directly on your type. You can easily do this by extending either the System.Collections.ObjectModel.Collection<T> or the System.Collections.ObjectModel.ReadOnlyCollection<T> class, which confusingly implement both the IList and the IList<T> interfaces. If you don't want your collection to be indexable, you can also just implement ICollection and ICollection<T>. Here's an example of a Heap implementation: