C# 4.0 New Features
Microsoft had some interesting presentations at the PDC in Los Angeles. Some of the newest features are (found from this http://channel9.msdn.com/pdc2008/TL16/)
- The new dynamic keyword, which allows for dynamic invocation of methods that you don't know at compile time. This dynamic keyword isn't like var although it appears to be. While var can represent any type, dynamic represents an object that will have its members dynamically invoked at run time. This allows for greater flexibility because normally you'd have to write additional reflection code, and this shortcuts this. There are some great examples.
- Optional properties in C#, which I should say finally this comes over from VB.NET. No longer do you have to specify every parameter in a method: you can use the following parameter syntax string name = "Brian" to assign a default value to a parameter in the method. This means you can leave out values, or specify optional values explicitly with paramName:"value".
- Eventually creating the C# compiler in managed code, making tapping into the compiler easier.
Some interesting stuff coming out of Microsoft. Stay tuned.