title: For vs. Linq - Performance vs. Future
body: <p>Very brief question. I have a randomly sorted large string array (100K+ entries) where I want to find the first occurance of a desired string. I have two solutions. </p>
  
  <p>From having read what I can my guess is that the 'for loop' is going to currently give slightly better performance (but this margin could always change), but I also find the linq version much more readable. On balance which method is generally considered current best coding practice and why?</p>
  
  <pre><code>string matchString = "dsf897sdf78";
  int matchIndex = -1;
  for(int i=0; i&lt;array.length; i++)
  {
      if(array[i]==matchString)
      {
          matchIndex = i;
          break;
      }
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>int matchIndex = array.Select((r, i) =&gt; new { value = r, index = i })
                           .Where(t =&gt; t.value == matchString)
                           .Select(s =&gt; s.index).First();
  </code></pre>