In my last blog entry i
totally neglected the fact that there are lamda
expressions.
This nice little C# 3.0
feature
makes anonymous
methods
much more readable. With that in mind, we can make our Times
method
much nicer.
2.Times( number => { Console.WriteLine("> " + number); } );
Compared to the former syntax, it increases readability considerably.
2.Times(
delegate(int number)
{
Console.WriteLine("> " + number);
}
);