C# 4.0, Windows 7

C#4.0 is starting to get in shape: Here is a list of the new features and some examples. Pretty cool stuff, finally we get optional arguments and support for dynamic objects.

Named arguments are interesting: You can now pass arguments to any method in any order by naming them explicitly. Paired with optional arguments, this fixes a number of usage problems I’ve encountered in C++ optional arguments. Nice to see that the C# team tries to do things right.

Co and contravariance is now supported. You can assign an IList<string> to IList<object> for example. But for contravariance, an IComparer<object> can also used in cases where a IComparer<string> is expected. So beware of the close encounters of the third kind of bugs. Also note that unboxing does not work for covariance: A IList<int> can not be assigned to a IList<object>.

There is also an interesting article about Windows 7, the successor of Vista on ArsTechnica. Probably there is some hope that Microsoft will take usability seriously now.

Besides, there is a prove from yesterday that P is not equal to NP. If this turns out to be true, it is a major milestone in theoretical computer science.

stay sharp!

yours
armin