title: Blocks - curly braces/no curly braces?
body: <p>When I started developing, I followed tutorials that always used <code>{}</code> (curly braces) to enclose blocks. However, when I began looking at other peoples code (classes on GitHub for example, or just more code in general than what a basic tutorial would show), however I've also seen block statements without being enclosed in <code>{}</code>, for example;</p>
  
  <pre><code>if($var &lt; 15)
       $string = 'Hello, Jimmy!';
  elseif($var &gt;= 15)
       $string = 'Hello, Anne!';
  </code></pre>
  
  <p>Is the same as</p>
  
  <pre><code>if($var &lt; 15) { 
      $string = 'Hello, Jimmy!';
  } elseif($var &gt;= 15) {
      $string = 'Hello, Anne!';
  }
  </code></pre>
  
  <p>I've never used blocks not enclosed in <code>{}</code>, however I used them today and I'm starting to see the efficiency of doing so (it looks a lot cleaner too, as I'll often find my functions riddled with <code>{}</code> from loops, conditionals etc.</p>
  
  <p><strong>What I'm asking is;</strong> </p>
  
  <p>a) are there any limitations on blocks without curly braces (; I noticed my IDE dropped back from an indent after I enter a single line and returned after an <code>if()</code> conditional?</p>
  
  <p>b) are there any best practices to be had, when not using <code>{}</code>?</p>
  
  <p>Any answers, specifically those inc. background/docs on the convention of curly brace usage for blocks vs. not using them would be greatly appreciated, as I'd really like to understand the usage of curly braces :)!</p>