Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is declaration expression dropped in C# 6?

Tags:

c#-6.0

In the preview for C# 6, Microsoft introduced the syntactic sugar for declaring out parameter inline as in seen in this article

http://odetocode.com/blogs/scott/archive/2014/09/15/c-6-0-features-part-3-declaration-expressions.aspx

Does anybody know why this feature is dropped in the release version of .NET 4.6?

like image 389
LxL Avatar asked Oct 16 '15 22:10

LxL


1 Answers

The explaination is in this codeplex topic.

Hi all,

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.

These decisions are primarily based on cost vs. risk. Some of the features you’ve seen in the previews still need a lot of downstream work to be supported in the IDE, debugger, etc., and also to get to great quality in the compiler itself.

As you’ve maybe heard me say before, language features are a secondary consideration in this release. 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 features we are cutting are:

  • Primary constructors in C# (along with initializers in structs)
  • Declaration expressions in C# / Out parameters in VB

They are both characterized by having large amounts of downstream work still remaining. 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.

All that said, I am sad to let these features go, and I know that goes for many of you as well. You’ve provided amazingly valuable feedback on both these features, and those learnings will feed directly into our future design work. I cannot thank you enough for this incredible engagement! I also hope you’ve enjoyed seeing more of the “inner workings” this time around, even if it leads to disappointment when you watch things come and go in our plans. Your increased involvement has certainly been rewarding for us, and – we hope! – helped improve the quality and timeliness of our decisions.

There’s a bit of good news too: string interpolation (which hasn’t been previewed yet) is currently looking to make it in. You should see that one show up first in C# (where we’ve already prototyped our approach), and a little later in VB.

Thanks again!

like image 81
Mariusz Pawelski Avatar answered Dec 25 '22 01:12

Mariusz Pawelski