<p>I had a little discussion with a friend about the usage of collections in return/input values of a method. He told me that we have to use
- the most derived type for return values.
- the least derived type for input parameters.</p>

<p>So, it means that, for example, a method has to get a ReadOnlyCollection as parameter, and as return a List.</p>

<p>Moreover, he said that we must not use List or Dictionary in publics API, and that we have to use, instead Collection, ReadOnlyCollection, ... So, in the case where a method is public, its parameters and its return values must be Collection, ReadOnlyCollection, ...</p>

<p>Is it right ?</p>

Regarding input parameters, it's generally more flexible to use the least specific type.  For example, if all your method is going to do is enumerate the items in a collection passed as an argument, it's more flexible to accept IEnumerable<T>.
For example, consider a method "ProcessCustomers" that accepts a parameter that is a collection of customers:
```
```
public void ProcessCustomers(IEnumerable<Customer> customers)
{
   ... implementation ...
}
```
```
If you declare the parameter as IEnumerable<Customer>, your callers can easily pass in a subset of a collection, using code like the following (pre-NET 3.5: with .NET 3.5 you could use lambda expressions):
```
```
private IEnumerable<Customer> GetCustomersByCountryCode(IEnumerable<Customer> customers, int countryCode)
{
    foreach(Customer c in customers)
    {
        if (c.CountryCode == countryCode) yield return c;
    }
}

... 
ProcessCustomers(GetCustomersByCountryCode(myCustomers, myCountryCode);
...
```
```
In general MS guidelines recommend not exposing List<T>.  For a discussion of why this is so, see
this blog entry
from the Code Analysis (FxCop) team.