What are the new features in C # v4.0?

Possible duplicate:
New interesting features in C # 4.0

Hello,

There are several (many) questions on SO about "what do you want in C # v4.0?". This question is different, I am not asking you what you would like to see in the new version of Microsoft, but what already exists since Microsoft Visual Studio 2010 Beta 1 is out now.

I myself only found additional options 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);
}

      

It's very difficult for me to find everything in this huge language because I don't know what is planned to be implemented. All I've seen are "What do you want in C # 4?" questions that don't help my progress grow.

What new feature have you found in VS2010 Beta1?

+1


a source to share


2 answers


On the C # Future page @MSDN you will find documentation about the new features that were added in the Beta1 version of C # 4.0, along with samples.



+4


a source


You are really asking two separate questions:

What new feature have you found in Vs2010 Beta1?

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



What are the new features in C # 4.0?

The biggest new feature is dynamic programming possible using the "dynamic" keyword . There are also optional parameters that you mention yourself.

In addition, the most important new feature is likely to be contravariance and covariance in generics. I won't try to explain it here as it would be quite lengthy, but check out Eric Lippert 's blog for a detailed explanation . He has a whole series on this subject and is explained in detail.

+1


a source







All Articles