title: Dictionary with delegate or switch?
body: <p>I am writing a parser which calls some functions dependent on some value.</p>
  
  <p>I can implement this logic with simple switch like this:   </p>
  
  <pre><code>switch(some_val)   
  {   
      case 0:   
          func0();   
          break;   
      case 1:   
          func1();   
          break;   
  }     
  </code></pre>
  
  <p>or with delegates and a dictionary like this:</p>
  
  <pre><code>delegate void some_delegate();   
  Dictionary&lt;int, some_delegate&gt; some_dictionary = new Dictionary&lt;int, some_delegate&gt;();   
  some_dictionary[0] = func0;   
  some_dictionary[1] = func1;   
  
  some_dictionary[some_value].Invoke();    
  </code></pre>
  
  <p>Are these two methods equivalent and which is preferred?</p>