title: Is List.Find<T> considered dangerous? What's a better way to do List<T>.Find(Predicate<T>)?
body: <p>I used to think that <a href="http://galilyou.blogspot.com/2010/07/listfindpredicate-considered-harmful.html" rel="noreferrer">List&lt;T&gt; is considered dangerous</a>. My point is that, I think default(T) is not a safe return value! <a href="http://www.reddit.com/r/programming/comments/cmexr/thats_why_i_think_listfindpredicatet_is/" rel="noreferrer">Many other people think so too</a> Consider the following: <br /></p>
  
  <pre><code>List&lt;int&gt; evens = new List&lt;int&gt; { 0, 2, 4, 6, , 8};
  var evenGreaterThan10 = evens.Find(c=&gt; c &gt; 10);
  // evenGreaterThan10 = 0 #WTF
  </code></pre>
  
  <p>default(T) for value types is 0, hence 0 is goona be returned is the above code segment! <br />
  I didn't like this, so I added an extension method called TryFind that returns a boolean and accepts an output parameter besides the Predicate, something similar to the famous TryParse approach. <br /> 
  Edit: <br />
  Here's my TryFind extension method: <br /></p>
  
  <pre><code>public static bool TryFind&lt;T&gt;(this List&lt;T&gt; list, Predicate&lt;T&gt; predicate, out T output)  
  {  
    int index = list.FindIndex(predicate);  
    if (index != -1)  
    {  
      output = list[index];  
      return true;  
    }  
    output = default(T);  
    return false;  
  }  
  </code></pre>
  
  <p>What's a your way to do Find on generic Lists? </p>