title: Loop starting from 0 or 1? Which one and why?
body: <p>Most of the for loops I have read/written start from 0 and to be fair most of the code I have read are used for embedded systems and they were in C/C++. In embedded systems the readability is not as important as code efficiency in some cases. Therefore, I am not sure which of the following cases would be a better choice:</p>
  
  <p><strong>version 1</strong></p>
  
  <pre><code>for(i = 0; i &lt; allowedNumberOfIteration; i++)
  {
  //something that may take from 1 iteration to allowedNumberOfIteration before it happens
    if(somethingHappened)
    {
       if(i + 1 &gt; maxIteration)
       {
         maxIteration = i + 1;
       }
    }
  }
  </code></pre>
  
  <p><strong>Version 2</strong></p>
  
  <pre><code>for(i = 1; i &lt;= allowedNumberOfIteration; i++)
  {
  //something that may take from 1 iteration to allowedNumberOfIteration before it happens
    if(somethingHappened)
    {
       if(i &gt; maxIteration)
       {
         maxIteration = i;
       }
    }
  }
  </code></pre>
  
  <p><strong>Why first version is better in my opinion:</strong></p>
  
  <p>1.Most loops starts with 0. So, maybe experienced programmers find it to be better if it starts from 0.</p>
  
  <p><strong>Why second version is better in my opinion:</strong></p>
  
  <ol>
  <li><p>To be fair if there was an array in the function starting from 0
  would be great because the index of arrays start from zero. But in
  this part of the code no arrays are used.</p></li>
  <li><p>Beside the second version looks simpler because you do not have to think about the '+1'.</p></li>
  </ol>
  
  <p><strong>Things I do not know</strong></p>
  
  <p>1) Is there any performance difference?</p>
  
  <p>2) Which version is better?</p>
  
  <p>3) Are there any other aspect that should be considered in deciding the starting point?</p>
  
  <p>4) Am I worrying too much?</p>