Haven't digested C#3? Brace yourself for V4!
After Microsoft’s PDC, a whole host of C# 4.0 infos are coming up. Many months ago we were already allowed to peek at Hejlsberg & Team sitting in an old meeting room, talking about what C# 4.0 would be all about (I have lost the link but you here’s his talk at the PDC about the upcoming language - Takes some time, but it’s pretty good).
UPDATE: You MUST watch at least the last 10 minutes. That stuff apparently won’t enter the C#4.0 but “Compiler as a Service” is pretty close to magic.
Major keywords were: Concurrency, ‘Declarativeness’, Dynamic Features.
Just now, posts are coming up highlighting information available on new language features - a good moment for me to gather some links…
The dynamic keyword:
For an interesting example introducing the dynamic Keyword, making an XMLNode behave like an instance with properties, go here. Such stuff may allow to do duck typing: Some sort of ad-hoc bolting on of an interface. For some comments on that, go here.
The Dynamic language runtime appears to become a first class citizen in the CLR. Wonderful new possibilities (and great bugs) are waiting for us to discover!
Parallel extensions for .NET is most likely becoming a part of the .NET Framework. At some point such things may appear in the language…
COM Interop: Ever used Type.Missing to save a Word Document in C#? Well, that has become wholly unnecessary
- Co- and contravariance on generic types: That one is going to hurt your head (Then again, if you have worked with generics you will most certainly have missed it once or twice)! Here is an example (taken straight from Anders’ slides):