views:

415

answers:

2

Possible Duplicate:
New Cool Features of C# 4.0

Hello,

There are several(many) questions at SO about "what do you want in C# v4.0?". This question is different,I'm not asking you what you'd like to see in the new version of Microsoft's baby,but what is already in there since Microsoft Visual Studio 2010 Beta 1 is already out.

I myself found only optional parameters implemented in VS2010.

void foo(int a,int b = 10)
{
    if(b != 10) throw new Exception();
}

void Main(string[] args)
{
    foo(5);
    foo(5,6);
}

Its very hard for me to find every single thing in that huge language,because I don't know what's planned to be implemented.All I've seen is those "What do you want in C# 4?" questions,which doesn't help my progress to grow up.

What new feature have you found in VS2010 Beta1?

+4  A: 

In C# Future page @ MSDN you'll find a documentation of the new features which were added to the Beta1 version of C# 4.0, along with samples.

Moayad Mardini
+1  A: 

You are really asking two separate questions:

What new feature have you found in Vs2010 Beta1?

This would be new IDE features, not language features. I do not know much about these, but I do know that the IDE has been rewritten in WPF and will have better support for multi-monitor. There is an article about other new features here. If you are doing XML/XSLT, the new XSLT debugging feature is neat.

What new features are in C# 4.0 ?

The biggest new feature is propably dynamic programming via the "dynamic" keyword. There are also optional parameters, which you mention yourself.

Beyond that, the most important new feature is likely to be contravariance and covariance in generics. I will not try to explain it here, since it would be quite lengthy, but do see Eric Lippert's blog for a thorough explanation. He has a whole series on the subject, and it gets explained in detail.

driis
+1 for the dynamic type keyword, for doing dynamic binding
Peter Gfader