Where did the C # naming convention come from?

I understand that T comes from Type , but why is the next K variable often used?

+7
generics c # naming-conventions
source share
3 answers

I saw K used for Key , but not often as a "next" parameter. For example, you will see

 Dictionary<K, V> 

where K for Key and V for Value .

Sometimes you will see T1 , T2 , etc. or T , U , V (the first is preferred here). But I prefer more descriptive names like

 Map<TSource, TDestination> 

or

 Create<TUnitOfWork> 
+22
source share

I guess this is from Key .

+1
source share

Another change is the GenericFunction<T1,T2,TResult> , where TResult is the type of value returned by functon. (as in, Func<T1,T2,...,TResult> )

+1
source share

All Articles