I am a .Net guy (even though this applies to java also), but I can’t find documentation or any literature which tells us why do we use alphabet T to represent Generic Class. If it was G we could have understood but why T.
Microsoft use them by starting them with T like TSource or TResult
public static void FooBar<TSource>(this IEnumerable<TSource> Foo)
{
}
Not only in .Net but in java also i have seen that this pattern. But Why?
T stands for “Type”. Which is about the best name you can use assuming your generic class is meant to handle any type.
G wouldn’t make sense because the type parameter is not itself the generic class.
Sometimes other initials get used when the type parameter is meant to refer to something more specific, e.g. Key and Value in: