New in C#4

Nick Sabalausky a at a.a
Wed Oct 29 14:14:32 PDT 2008


"bearophile" <bearophileHUGS at lycos.com> wrote in message 
news:ge9sf5$1vdc$1 at digitalmars.com...
> Thanks to Reddit I have found a nice short document that lists some of the 
> differences of C#4:
> https://docs.google.com/View?docid=dcj4xk6_17ffc7nmgv
>
> They have added a dynamic invocation, useful if you want to implement a 
> dynamic language (like IronPython, IronRuby, etc) on top of the dotnet. 
> Object-C shows this is doable in a very C-like language, and the Boo 
> language shows that in a statically typed language it can be useful to use 
> a Duck type once in a while to reduce the "static type pressure". More 
> info on this last concept in the Boo site.
>
> Something that I like a lot is the named arguments, that I hope to see in 
> D and Delight someday. They are used often in Python, and they help 
> increase the readability of the code, sometimes even reducing mistakes.
> They have used colons:
> foo(x: 1, z: 3)
> While Python uses equal signs:
> foo(x=1, z=3)
> I think they are about equally readable.
> (I think there's a problem with named arguments, that you can solve in 
> some ways, for example with an extra hidden bitfield argument that encodes 
> what arguments are given and what not).
>
> Bye,
> bearophile

I'm dissapointed...but not surprised. Looks like the templates are still 
gimped: I don't see anything about an IArithmetic or operator constraints.

I'm also dissapointed with the focus on dynamic programming as I've really 
never seen much need for such a thing in a static language (or in any 
language, IMO). Most people experienced with static typing are probably well 
aware of the pitfalls dynamic typing introduces, so I won't point them out. 
And as far as I've seen, the only benefits that can't already be achieved 
just fine through templates or boxing are just incredibly trivial things 
like not creating an extra variable to hold the string equivilant of one of 
your ints. 





More information about the Digitalmars-d mailing list