I admit that this question is subjective but I am interested in the view of the community. I have a cache class that takes a cache loader function of type Func
I typically actually use the work delegate in my naming, to make it obvious that this parameter is receiving a delegate. For example, I'd potentially name the above:
public static class Cache
{
public TResult Get(string cacheKey, Func cacheLoadingDelegate)
{
// Implementation
}
}
I do this specifically to avoid confusion from the suggested naming in the question. cacheLoader
sounds too much like an object, and loadResult
like an object/type (the result itself). I also don't personally like using function
or method
, as a delegate is not actually a function, but rather a delegate - a type that references a function.