title: When do you use code blocks?
body: <p>When do you use code blocks in C/C++/C#, etc.? I know the theoretical reason behind them, but when do you use them in real programs?</p>
  
  <p><strong>EDIT</strong>: I have just realised that I use them in <code>switch</code> statements, where variables would otherwise be in the same scope (grr for things like <code>i</code>):</p>
  
  <pre><code>switch (x) { case "abc": { /* code */ } break; }
  </code></pre>
  
  <p>etc
  (Just to clarify, in a switch statement, the extra braces are <em>NOT</em> required.)</p>
  
  <hr>
  
  <p>Related:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/249009/do-you-use-curly-braces-for-additional-scoping">Do you use curly braces for additional scoping? (https://stackoverflow.com/questions/249009/do-you-use-curly-braces-for-additional-scoping)</a></li>
  </ul>