title: Ugly thing and advantage of anonymos method -C#
body: <p>I was asked to explain the ugly thing and advantages of anonymous method.</p>
  
  <p>I explained possibly  </p>
  
  <p><strong>Ugly thing</strong></p>
  
  <pre><code>anonymous methods turning quickly into spaghetti code.
  </code></pre>
  
  <p><strong>Advantages</strong></p>
  
  <p>We can produce thread safe code using anonymous method :Example</p>
  
  <pre><code>static List&lt;string&gt; Names = new List&lt;string&gt;(
    new string[] {
      "Jon Skeet",
      "Marc Gravell",
      "David",
      "Bill  Gates"
    });
  
  static List&lt;string&gt; FindNamesStartingWith(string startingText)
  {
    return Names.FindAll(
      delegate(string name)
      {
        return name.StartsWith(startingText);
      });
  }
  </code></pre>
  
  <p>But really i did not know whether it is thread safe or not.I was asked to justify it.
  Can any one help me to understand
  <strong>(1) advantages of anonymous methods
  (2) Is the above code  thread safe or not?</strong></p>