2009: A dynamic future of C#

70s coders learn C, Pascal, COBOL(one of the best IT jobs in economic crisis)
80s coders learn C
90s coders learn C++, Java, Delphi
21-century (long time no see this hot word during 1999-2001) coders learn C#?

  • A homemade rumor by anonymous craven

On PDC 2008, Anders, former architecture of Turbo Pascal, Delphi, Visual J++, currently the father of C#, gives us a presentation “The Future of C#” about what new features C# 4.0 will have. The demo “Compiler as a service” is really cool. Think about the prompt “C# >”.

Mads Torgersen, C# Language PM gives a public released document on C# Future site, describes four main new features:

> ##### Dynamic lookup
Dynamic lookup allows you to write method, operator and indexer calls, property and field accesses, and even object invocations which bypass the C# static type checking and instead gets resolved at runtime.

> ##### Named and optional parameters
Parameters in C# can now be specified as optional by providing a default value for them in a member declaration. When the member is invoked, optional arguments can be omitted. Furthermore, any argument can be passed by parameter name instead of position.

> ##### COM specific interop features
Dynamic lookup as well as named and optional parameters both help making programming against COM less painful than today. On top of that, however, we are adding a number of other small features that further improve the interop experience.

> ##### Variance
It used to be that an IEnumerable wasn’t an IEnumerable. Now it is – C# embraces type safe “co-and contravariance” and common BCL types are updated to take advantage of that.

My comments:

side effect

Dynamic lookup
dynamic (runtime type detection) versus var (compile time type inference) introduced in C#3.0.
No handwritten reflection codes any more.
No IntelliSense when programming.
Difficult to defend unknown runtime exceptions, errors.
Named and optional parameters
ease function call of COM interop like VSTO, etc.
Named parameters looks Pythonic. But maybe Jim like this?
COM specific interop features
based on previous two new features, it’s easier.
The biggest benefit: no runtime PIA more!
N/A? Time to migrate old workaround code.
more friendly
as above.

These new features certainly relies on new .NET framework. At least, dynamic is not a language sugar like var.

Overall, C# is becoming more and more free-style language, combined compile-time and run-time power. It’s worthy to take a look at what C# will be if you are a C# developer or even a Java, C++ lover. Write less, do more. That’s the best value of the C# evolution, IMO.