KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Are there any conventions / guidelines for naming associative arrays (e.g. Dictionary<TKey, TValue> ) in .NET? For example, is there a better way to name dict in: var dict = new Dictionary<Foo, Bar>(); Some names I've used / seen: foosToBars mapFromFooToBar barsByFoo barsForFoos I've also seen some types in the BCL choosing 'nicer' sounding names that don't directly reveal what the key and value are supposed to represent, such as in this method . How about for multimaps (e.g. ILookup<TKey, TElement> )? EDIT : Perhaps my example was slightly poor; I didn't mean to focus on the types of the key and value. How about if it was: // key = Name of person, value = Age of person var dict = new Dictionary<string, int>(); With the samples updated to: namesToAges mapFromNameToAge agesByName agesForNames
Tags (comma-separated)
Save Edits
Cancel