Anders Hejlsberg didn’t take up my suggestions for new language features in C# 4.0, damn him. Instead we’re stuck with the moronic dynamic, a nod of the head towards stupidity and indolence.
The idea is that it’ll be easier to do some things which are currently fairly difficult, like interop with COM, and with dynamic languages like IronPython and IronRuby. In actual fact, the huge hidden cost is runtime initialisation of the whole DLR, which is not insignificant.
I quite admire the DLR, although (again) Microsoft have taken all the credit for clever techniques which are, in actual fact, quite old. Watch them do the same with HPC, MPI, and hosted applications (the cloud, whatever that means).
I won’t start a tirade about dynamic languages – they are what they are. But let’s not confuse ourselves: the words dynamic and huge runtime cost should be seared onto a developers’ mind next to each other. Any value whose type can’t be determined at compile time must, by definition, be determined at runtime. A compiler’s raison d’etre is to defer that cost – so beware, if you value productivity over speed of execution.
I still hold out hope for language support for ad-hoc tuples, although there are certainly strong arguments against their use. Members are anonymous, so they make a public API confusing. There are constructs for structured data already – the clue’s in the name. The language is already big and convoluted, and there are other .NET languages that support them – C# shouldn’t be a panacea.
Get rid of var – that’d be the best thing. Or restrict its use so that lazy developers can’t use it to replace string or (why?!) int.