I was searching a bit the new C# 4.0 features revealed in these days and the main thing that gives me a little of surprise and doubts is the new dynamic keyword.
This new keyword allows you to declare an object whose method calls will be resolved at runtime. This is extremely different from the normal C# behaviour (static typing): actually when you call a method or a property of an object, the compiler checks if it exists and, if not, it raises a runtime error.
With dynamic typing, you can write something like this:
dynamic MyInt = 1;
dynamic MyString = "Hello world!";
It seems to me like a VAR declaration but with a runtime resolution...
Dynamic typing is certainly not a news in the world of computer languages (Python is an example of good dynamically-typed language), but I'm thinking about what could be the real advantages of this feature... maybe interoperability with other dynamically-typed languages?
I can agree that dynamic typing could be a panacea for certain scenario, but I'm a big fan of the old and elegant compile-type check and object casting. I also think (but maybe I'm wrong) that runtime bug detection (instead at compile time) could be a problem.
And what about the performance overhead of declaring a dynamic object variable?
I think that someone will solve my doubts soon...