title: Is it good practice to use counters?
body: <p>Here are two alternative codes (coded in Julia) that do essentially the same thing.</p>
  
  <pre><code>counter = 0
  for i = myArray
      counter = counter + 1
      Do1(i)
      Do2(counter)
  end
  </code></pre>
  
  <p>and</p>
  
  <pre><code>for counter = 1:length(myArray)
      i = myArray[counter]
      Do1(i)
      Do2(j)
  end
  </code></pre>
  
  <p>What is the good practice? Which code is faster? Which code consumes less memory? Which code is less error prone? Why?</p>