title: Is there a shorter/simpler version of the for loop to anything x times?
body: <p>Usually we do something like a for or while loop with a counter:</p>
  <pre><code>for (int i = 0; i &lt; 10; i++)
  {
      list.Add(GetRandomItem());
  }
  </code></pre>
  <p>but sometimes you mix up with boundaries. You could use a while loop instead, but if you make a mistake this loop is infinite...</p>
  <p>In Perl for example I would use the more obvious</p>
  <pre><code>for(1..10){
      list-&gt;add(getRandomItem());
  }
  </code></pre>
  <p>Is there something like <code>doitXtimes(10){...}</code>?</p>