title: nesting if statements
body: <p>Which is better, nesting an if statement inside the if block, or inside the else block?</p>
  
  <p>a. </p>
  
  <pre><code>if (cond1)
     if (cond2){
        statement1;
        statement2;
        ...
     }
     else {
        statement3;
        statement4;
        ...
     }
  
  else {
     statement5;
     statement6;
     ...
  }
  </code></pre>
  
  <p>b. </p>
  
  <pre><code>if (!cond1) {
     statement5;
     statement6;
     ...
  }
  
  else if (cond2) {
     statement1;
     statement2;
     ...
  }
  
  else {
     statement3;
     statement4;
     ...
  }
  </code></pre>
  
  <p>Thanks for the replies so far. I just edited the options, but my main concern really is just this: If you have a choice, (by changing the conditional expressions) is it better to nest an if statement in a higher level if's if block or its else block? (a) is just an example of nesting the if in the if block, and (b) is an example of nesting the if in the else block. Thanks again for everyone's time.</p>