title: Good Practice: Loop And If statement
body: <p><em>(I'm copy/pasting the same question I posted on Codereview here: <a href="https://codereview.stackexchange.com/questions/1747/good-practice-loop-and-if-statement">https://codereview.stackexchange.com/questions/1747/good-practice-loop-and-if-statement</a>)</em></p>
  
  <p>I'd like to know what is the best practice:</p>
  
  <p>version A:</p>
  
  <pre><code>loop1
    if condition1
      code1
  
    if condition2
      code2
  
    if condition3
      code3
  </code></pre>
  
  <p>Or, version B:</p>
  
  <pre><code>if condition1
    loop1 with code1
  
  if condition2
    loop1 with code2
  
  if condition3
    loop1 with code3
  </code></pre>
  
  <p>I've implemented version B cause it's more readable for me, and always checking the same condition seems absurd.</p>
  
  <p>But looping n times the same array could be seen as absurd too :)</p>