Simple example - you have a method or a property that returns an IEnumerable and the caller is iterating over that in a foreach() loop. Should you always be using
I don't think so. As @LBushkin suggests, if you were going to return something as a whole, you'd return an IList or whatever. If you're returning an IEnumerable, people expect deferred execution, so I think you should always use yield in that case.