web 2.0

C# 4.0 - New Features

This article summarizes the changes that are going to be present in C# 4.0. C# 4.0 is scheduled to be released sometime during 2010 along with the new version of Visual Studio which has been "Rosario". In the meantime, if you are an early adopter, CTPs will be made publicly available as a Virtual PC image. Dynamic Look up - This feature will give you the ability to resolve names during run time instead of at compile time. In Visual Basic .NET this is referred to as "late binding" and has been available for quite some time now. Dynamic look up will be very useful for solutions which involve any kind of COM Interop. COM Interop allows .NET code to call COM components and COM code to call .NET components. An example of this would be Office automation. Named and optional parameters - Finally we have the ability to specify default values for parameters. In additional optional arguments can be added to the method signature. These changes should reduce the need for method overloading and increase the compatibility between C# and Visual Basic. Covariance and Contravariance - These topics can be a little bit hard to wrap your head around. Therefore lets starts with some definitions. An operator between types is said to be covariant if it orders these types from more specific to more general ones. Similarly an operator between types is said to be contravariant if it orders them in the reversed order. Whenever neither of these conditions is met, an operator is said to be invariant. In any case covariance, contravariance and invariance already exist in the C# language. The changes made in 4.0 will just make these features a little easier to utilize. For a good overview of the topic read Charlie Calvert's post. If you still want more information then visit Eric Lippert's blog. He has a series of posts on the topic. In conclusion, C# 4.0 will continue to evolve based on the trend of dynamic programming. This is primarily due to a ripple effect created by languages like IronRuby, IronPython and Visual Basic. On the flip side, VB will also get some language enhancements in order to keep it on even keel with C#. Perhaps someday the classic debate between C# and VB.NET developers about which language is better may start to fade away. This will be primarily due to the standardization of features across languages.

Tags:

blog comments powered by Disqus