What's new in Visual C# 2010

Visual C# 2010 (also sometimes called C# 4.0) allows optional and named arguments (hooray!).  See also our list of Visual Studio 2010 changes and what's new in ASP.NET 4.0.

Specific new or changed features in Visual C# 2010 include:

New/changed Visual C# 2010 feature - AUTOMATIC SELECTION OF KEYWORDS

You can now pass arguments to a method in C# by name as well as position (VB programmers will be wondering why it took so long).  In the following example, the shaded text wouldn't have worked in earlier versions of C#:

Automatic selection of keywords

New/changed Visual C# 2010 feature - OPTIONAL ARGUMENTS

You can now use optional arguments (again, VB programmers will be scratching their heads at how it took so long).  In the example below, the argument height is assigned a default value of 2, so it can be omitted from a call to the CalculateBMI method:

Optional arguments

New/changed Visual C# 2010 feature - CALL HIERARCHY WINDOWS

The new call hierarchy window allows you to see calls to and from a selected method, property, or constructor:

Call hierarchy windows

You can view a full list of changes in recent versions of Visual C# by returning to our main Visual C# version history page.

.NET versions

All content copyright Wise Owl Business Solutions Ltd 2012.  You can follow us on FaceBook. All rights reserved.