|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;
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:
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:
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:
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.
To be informed about new articles on I Programmer, install the I Programmer Toolbar, subscribe to the RSS feed, follow us on, Twitter, Facebook, Google+ or Linkedin, or sign up for our weekly newsletter.
or email your comment to: email@example.com
|Last Updated ( Friday, 03 October 2014 )|