title: C# 3.0 Tuple Equivalents (for poor men)
body: <p>I find myself occasionally in C# 3.0 looking for ways to simulate the notion of a tuple. Over time I've had various "poor man's" implementations, here are a few of them:</p>
  
  <p><strong>Basic Object Array</strong>:</p>
  
  <pre><code>object[] poorTuple = new object[]{foo,bar,baz}; // basic object array
  </code></pre>
  
  <p><strong>More Strongly Typed</strong>, HoHoHo...</p>
  
  <pre><code>KeyValuePair&lt;TypeA, KeyValuePair&lt;TypeB, TypeC&gt;&gt; poorTuple;
  </code></pre>
  
  <p><strong>Implementing a class</strong> that can use type inference (lifted from <a href="http://www.manning.com/petricek/" rel="nofollow noreferrer">Functional Programming for the Real World</a>)</p>
  
  <pre><code>public static class Tuple{
    public static Tuple&lt;T1, T2&gt; Create&lt;T1 foo, T2 bar&gt;{
      return new Tuple&lt;T1, T2&gt;(foo, bar);
    }
  }
  // later: 
  var data = Tuple.Create("foo", 42);
  </code></pre>
  
  <p>Questions: </p>
  
  <ol>
  <li><p>Any other ways to have a poor man's tuple in C# 3.0 (or language of choice that lacks the data structure). </p></li>
  <li><p>What is the <em>best</em> way to get a tuple in C# 3.0 - if anyone has a library recommendation it is welcome.</p></li>
  <li><p>At what point (yes, generalize for me) does it make sense to create a specific type rather than something like a list or tuple? (looking for rules of thumb) </p></li>
  </ol>