I work with C# professionally and I write code like this all the time.
private IEnumerable<Something> GetAlotOfSomething()
{
if (somethingA.IsReady)
yield return somethingA;
if (somethingB.IsReady)
yield return somethingB;
if (somethingC.IsReady)
yield return somethingC;
// ... More complex logic
}
var specialSomethings =
GetAlotOfSomething()
.Where(s => s.IsSpecial);
Then one day I have to write a bit of VB6 or JScript and I end up writing so much boilerplate just to get things done. Anyone thoughts?