The Add-method from the ICollection(T) interface has been explicitly implemented by the LinkedList(T)-class. This collection instead have AddFirst- and AddLast-methods (among others). The explicitly implemented method maps to the AddLast-method. This has some drawbacks and IMHO no benefit at all. The two major drawbacks are this:
- You can't use collection initialization on a LinkedList(T) since it requires an Add-method.
- If you have used let's say a List(T) in a method and want to change it to use a LinkedList(T) instead you'll have to update all calls to Add to call AddLast instead.
The way I think about it is that you should never explicitly implement interface members unless they make no sense at all when you know the concrete type. For example the Add-method should be explicitly implemented (and effectively hidden) if you were implementing a read only ICollection(T).
Are there other examples of methods that have been explicitly implemented that shouldn't have been in the framework?
As a side note: To resolve the number 2 issue you could create an extension method "Add" for the LinkedList(T)-class.