title: What's the purpose of using braces (i.e. {}) for a single-line if or loop?
body: <p>I'm reading some lecture notes of my C++ lecturer and he wrote the following: </p>
  
  <blockquote>
    <ol>
    <li>Use Indentation // OK</li>
    <li>Never rely on operator precedence - Always use parentheses // OK </li>
    <li>Always use a { } block - even for a single line // <strong>not OK</strong>, why ???</li>
    <li>Const object on left side of comparison // OK </li>
    <li>Use unsigned for variables that are >= 0  // nice trick </li>
    <li>Set Pointer to NULL after deletion - Double delete protection // not bad</li>
    </ol>
  </blockquote>
  
  <p>The 3rd technique is not clear to me: what would I gain by placing one line in 
  a <code>{ ... }</code>? </p>
  
  <p>For example, take this weird code:</p>
  
  <pre><code>int j = 0;
  for (int i = 0 ; i &lt; 100 ; ++i)
  {
      if (i % 2 == 0)
      {
          j++;
      }
  }
  </code></pre>
  
  <p>and replace it with: </p>
  
  <pre><code>int j = 0;
  for (int i = 0 ; i &lt; 100 ; ++i)
      if (i % 2 == 0)
          j++;
  </code></pre>
  
  <p>What's the benefit of using the 1st version? </p>