 <blockquote> <p>why use [yield]? Apart from it being slightly less code, what's it do for me?</p> </blockquote> <p>Sometimes it is useful, sometimes not. If the entire set of data must be examined and returned then there is not going to be any benefit in using yield because all it did was introduce overhead.</p> <p>When yield really shines is when only a partial set is returned. I think the best example is sorting. Assume you have a list of objects containing a date and a dollar amount from this year and you would like to see the first handful (5) records of the year. </p> <p>In order to accomplish this, the list must be sorted ascending by date, and then have the first 5 taken. If this was done without yield, the <em>entire</em> list would have to be sorted, right up to making sure the last two dates were in order.</p> <p>However, with yield, once the first 5 items have been established the sorting stops and the results are available. This can save a large amount of time.</p>