title: Is there a benefit to Tuple-based or Nested Dictionaries?
body: <p>I've been looking for a way to store and retrieve values on more than the single key that C#'s generic Dictionary class provides.</p>
  
  <p>Searching around the web (<a href="https://stackoverflow.com/questions/2877660/composite-key-dictionary">and on SO itself</a>) has shown me a couple options:</p>
  
  <p><strong>Tuple Based Dictionaries</strong></p>
  
  <p>.NET 4.0 makes it easy to support a generic Tuple&lt;,> class. This means you can make a Dictionary out of any arbitrary Tuple, i.e.,</p>
  
  <ul>
  <li><code>var myDict = new Dictionary&lt;Tuple&lt;Char, Int&gt;, MyClass&gt;();</code></li>
  </ul>
  
  <p><strong>Nested Dictionaries</strong></p>
  
  <p>I've learned you can also nest Dictionaries within Dictionaries, which makes accessing the stored result similar to accessing an N-Dimensional array. For instance:</p>
  
  <pre><code>Dictionary&lt;int, Dictionary&lt;int, Dictionary&lt;Char, MyClass&gt;&gt;&gt;
  </code></pre>
  
  <p>which could then be accsessed by: <code>MyClass foo = MyData[8][3]['W'];</code></p>
  
  <p><strong>Delimited Concatenated Key Dictionaries</strong></p>
  
  <p>But while both <em>work</em> well for complex data and custom classes, I wonder if they're always necessary. For primitive data, at least, it would seem that concatenating the keys with a delimiter is just as effective.</p>
  
  <pre><code>//keys are char + int
  Dictionary&lt;string, MyClass&gt; myDict = New Dictionary&lt;string, Myclass&gt;();
  String input = myChar + "|" + myInt
  MyClass foo = myDict[input]
  </code></pre>
  
  <p>Are there any scenarios which make one of these methods superior to the other? Will they have similar performance times? Or should the focus be instead on which method provides the cleanest, easiest to maintain, code?</p>
  
  <p>Thoughts?</p>