i was reviewing a piece of code of a colleague, and i came across a very familiar pattern of code. basically he had a list of employees where he wanted to "loop" over and exclude any employees with age over 30. so his first attempt was the most common one: he used a foreach loop to remove all...
one of the core functionalities of .NET 4.0 is its support for Dynamic languages. this is done primarly through the Dynamic Language Runtime (DLR) on top of the CLR. this post shows some of the usages of dynamic in C# 4.0. consider the following class: public class Sample { public static int Add(int...
C# 4.0 now supports the optional and named prameters. this feature was already there in VB.NET so it is a C# language enhancement. consider the below class: class Optional { public void DoOperation(string name = "hello", int age = 4) { Console.Write("Name {0}, Age {1}", name, age...