title: List<T>.Insert vs Stack<T>.Push
body: <p>I am returning a <code>IList&lt;T&gt;</code> from a method.</p>
  
  <p>In the calling class I want to insert a value at the start of the list/stack.</p>
  
  <p>Inserting a value in <code>List&lt;T&gt;</code> is slower than pushing a value in <code>Stack&lt;T&gt;</code>. But to use stack I need to unbox it.</p>
  
  <p>So the question is which one is better, unbox or using <code>Insert</code> in <code>List&lt;T&gt;</code>? Which one is costlier?</p>
  
  <pre><code>class MyClass 
  {
  }
  
  IList&lt;MyClass&gt; Method1()
  {
  }
  
  class MainClass
  {
     List&lt;MyClass&gt; list = (List&lt;MyClass&gt;)Method1();
     list.insert(0,new MyClass{...}); //insert at the start. 
  
     Stack&lt;MyClass&gt; stack = (Stack&lt;MyClass&gt;)Method1();
     stack.Push(new MyClass{...}); //insert at the start
  }
  </code></pre>