Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • Thanks! I understand the design principles. My question was more about this specific case - what can be a reason for System.Collections.Generic designers not to include RemoveAll in IList interface? Commented Aug 9, 2015 at 11:10
  • @SergeyKandaurov I would guess because they applied the above design principles for this specific case and figured that it's not a requirement they want to impose on people who implement these collections or a contract they want to maintain with the consumers of these collections. Keep in mind that RemoveAll can be implemented in terms of the already exposed members (without knowing its internals), so there's no reason to require the collection to implement it for you. Commented Aug 9, 2015 at 11:16
  • 1
    Makes sense now. Then I guess there should be some interface declaring RemoveAll for developer's convenience in order not to force using List<> or creating custom extension methods. Commented Aug 9, 2015 at 11:24