Nongeneric interfaces and collection classes
In "C#12 In A Nutshell", they say:
"As with the interfaces we discussed previously, you usually have a choice of generic or nongeneric versions of each type. In terms of flexibility and performance, the generic classes win, making their nongeneric counterparts redundant except for backward compatibility. This differs from the situation with collection interfaces, for which the nongeneric versions are still occasionally useful."
But the only example they gave was for type unification (since you can't cast IEnumerable<int> to IEnumerable<object> for example). Why is that that type unification is useful just for interfaces and not for collection classes themselves? As far as I understand you can't cast int[] to object[] either.
Do you have scenarios in mind for which Nongeneric interfaces are useful and nongeneric collection classes are not?
"As with the interfaces we discussed previously, you usually have a choice of generic or nongeneric versions of each type. In terms of flexibility and performance, the generic classes win, making their nongeneric counterparts redundant except for backward compatibility. This differs from the situation with collection interfaces, for which the nongeneric versions are still occasionally useful."
But the only example they gave was for type unification (since you can't cast IEnumerable<int> to IEnumerable<object> for example). Why is that that type unification is useful just for interfaces and not for collection classes themselves? As far as I understand you can't cast int[] to object[] either.
Do you have scenarios in mind for which Nongeneric interfaces are useful and nongeneric collection classes are not?