Just read an interesting post on the new stuff coming in .NET 4.0, specifically in C#. Here’s some quick samples:
1 2 3
With the example above, .NET reflects the object, determines if there’s a method that’s called “Add”, takes two ints as method arguments, and returns an int. If it doesn’t find one it’ll throw a runtime error.
Optional & Named Parameters
Forget all that method overloading we used to have to do, now we can specify optional parameters, AND define which of the optional parameters we want to pass in!
1 2 3 4 5 6 7 8 9 10