title: Declaring a variable inside or outside an foreach loop: which is faster/better?
body: <p>Which one of these is the faster/better one?</p>
  
  <p>This one:</p>
  
  <pre><code>List&lt;User&gt; list = new List&lt;User&gt;();
  User u;
  
  foreach (string s in l)
  {
      u = new User();
      u.Name = s;
      list.Add(u);
  }
  </code></pre>
  
  <p>Or this one:</p>
  
  <pre><code>List&lt;User&gt; list = new List&lt;User&gt;();
  
  foreach (string s in l)
  {
      User u = new User();
      u.Name = s;
      list.Add(u);
  }
  </code></pre>
  
  <p>My newbie-developing skills tells me the first one is better, but a friend of mine tells me im wrong, but could not give me a good reason why the second one is better.</p>
  
  <p>Is there any difference in performance at all?</p>