1. Yield Return in C#

    In c# you can use yield return instead of declaring a collection, adding to it then returning it all at once. The code ends up looking a lot cleaner as you can see in the examples below.

    private static IEnumerable<double> StopwatchExampleYield()
            for (int i = 0; i < 3; i++)
                    Thread ...
    Tagged as : csharp

Page 1 / 1