Dynamic type support in C# aka Late Binding
VB6 and VB.Net developers know this feature: "Late Binding" and C# developers have often ridiculed that option. Buit it seems that the next version of Visual Studio will support a feature called "Dynamic type support". An article on this new feature can be found here, at Charlie Calvert's Community Blog. James Manning likes the idea but has some remarks about the suggested implementation. You can read about that here.
Currently, C# developers will need to use reflection to instantiate the object and discover methods and properties. The way the C# team are thinking about the implementation will make dynamic objects work something like this:
static void Main(string[] args)
{ dynamic
{ object myDynamicObject = GetDynamicObject();
myDynamicObject.SomeMethod(); // call a method
myDynamicObject.someString = "value"; // Set a field
myDynamicObject[0] = 25; // Access an indexer
}
}
If you've worked with reflection before, you immediately see how simple this will be. And the way it will be integrated into the CLR will allow other languages to use this as well.
Looks like another promising feature for C#!