I know the "I" convention has been around since COM, but I've never understood why it hasn't been reconsidered like every other naming convention before .NET has.
Consumption wise, the only thing that separates an interface from, say, an abstract class, is that they can be multiply inherited. But everything after Visual Studio 2003 has shown type signatures in tooltips, so it's as useless as all the other Hungarian notations that have been discarded.
I also thought it might be so that you can have a basic implementation of the interface with the same name, e.g. Message
inheriting IMessage
, but most of the .NET libraries have gone for adding the word "Base" at the end (e.g. System.Collections.ReadOnlyCollectionBase
) instead -- and this makes more semantic sense.
COM interop seems to be another possible reason -- but it's not as if the wrapper classes that it generates are perfectly idiomatic .NET, so I doubt that that was an aesthetic consideration.
In one of my newer projects I've forgone the convention entirely, and it feels just fine. Is there something I'm missing?
IList
is a general term for a sequenced, contiguous collection, random access, whereasList
is a sequenced, contiguous, random access, growing collection. I think F# had it right in aliasingList
toResizeArray
; that's definitely a much more descriptive name.IList
then could have beenList
, so that doesn't seem like it would be a reason either.