Latest On C# 6 And VB 12
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.

 

Csharp6

 

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 \{record.name) 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. 

 

Csharp6

 

Banner


Enrol Now For Udacity Intro to Self-Driving Cars Nanodegree
21/05/2018

Self-Driving Cars;sounds seriously challenging and not for mere mortals. Could it be otherwise? Yes, and that's what Udacity is trying to change with this nanodegree, to render the topic of self drivi [ ... ]



Watch An Inverted Pendulum - Arduino-Driven
02/06/2018

If you have never seen an inverted pendulum in action - it's fun. What is even more fun is implementing one. Is it IoT? Is it control theory? Is it AI? It can be any and all - and did I mention it's f [ ... ]


More News

 

justjsquare

 



 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Friday, 03 October 2014 )
 
 

   
RSS feed of news items only
I Programmer News
Copyright © 2018 i-programmer.info. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.