Latest On C# 6 And VB 12
Written by Mike James   
Friday, 03 October 2014

The latest news from the Microsoft compiler team is that, because the performance and quality of Roslyn is more important, it is time to cut new features from the .NET languages.




The news isn't that bad, however, and it really shouldn't be taken as any hint of failure or backtracking. It is more realistic to trim back on features than produce a release that doesn't quite work.  Mads Torgersen writes:

"As we enter the final stage in our long quest to renew the C# and Visual Basic experience, we’ve had to make some tough decisions around the set of language features that will make it into the next version of the languages. "

and gives the reason:

"The primary goal is to deliver a magnificent first release of the Roslyn value proposition: deep language understanding in the IDE and available to everyone through a robust and comprehensive API. To deliver this well, we need to scale back our appetite for language features a bit." 

The main features that are being cut are;

  • Primary constructors in C#
  • Declaration expressions in C#

The reason for picking on these two features is that support for them in the IDE and downstream of the compiler aren't as complete as for other features.

A primary constructor provides another way to initialize objects and can be replaced by a suitable explicit constructor. If you include something that looks like a constructor as part of the class definition, for example:

public class Point(int x, int y){}

then private members are created for the parameters and automatically assigned when the class is created. 

Declaration expressions are simply the result of being able to declare variables within an expression. For example:

var y= (int x =3) * x;

sets y to 9.  

Although both seem trivial, the compiler team sees them as the start of something more advanced:

"They are also features that we see as the potential beginning of a bigger story further down the line: primary constructors could grow up to become a full-blown record feature, and declaration expressions would form the corner stone of pattern matching and deconstruction facilities. Now, those features will all be considered together for a later release. As a silver lining we then get to design this continuum holistically, rather than in steps that might tie our hands unduly in a later phase. "

On the plus side string interpolation, which wasn't expected to make it into the next version, probably will. String interpolation can be used to incorporate variables into strings:

"Hello \{ how are you to day"

Overall it is good to see both C# and VB .NET being enthusiastically developed. It is a shame that the same thing can't be said for .NET in general - with WPF still looking a bit like a forgotten technology. 





Microsoft's Cybersecurity For Beginners

A free, self-paced course about Cybersecurity 101 is on offer by Microsoft's Cloud Security Advocates. It's a 30+ lesson curriculum targeted at complete novices.

Turing Chatbot Is Chief AI Officer

It was only a matter of time before it happened. A company has created an Alan Turing chatbot and has installed it as its Chief AI officer. A distasteful PR stunt to many, but it's more complicated th [ ... ]

More News


raspberry pi books



or email your comment to:

Last Updated ( Friday, 03 October 2014 )