C# ChangeNowość NR.4Zauważyłem, że wiele osób odwiedza moje wpis na temat c# 6.0. Warto jednak poinformować was, że od 1 października 2014 pewne funkcję zostały usunięte mimo iż one już działały.

Istnieje już danej nowej funkcyjności nie daje jej gwarancji egzystencji.

Został wiec usunięte dwie funkcjonalności:

  • Primar construtors
  • Declaration expression

Użycie ich już wyjaśniłem w swoich wpisach.

Dlaczego został usunięte.

Pomysł z Primar Constructors został zaczerpnięty z F# i jego składni klasy. Sama funkcjonalność jednak nie ma takiej mocy bez innych funkcji języka F# jak “pattern matching” i dostępności do danych “type Provider”.

Dlatego panowie stwierdzili, że jeśli taka funkcja w C# ma się pojawić to musi ona zawiera wiele innych funkcji z F#, które sprzyjają użyciu “Primar Constructors”.

Mechanizm “Declaration Expression” też jest zaczerpnięty z F# i jego funkcja została cofnięta z tego samego powodu.

Oto oficjalny tekst odpowiadający dlaczego te funkcje zostały wstrzymane:

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.

Można przeczytać dalej o tym w oficjalnym temacie CodePlex tutaj.

Jakby ktoś jeszcze się zastanawiał w którym kierunku idzie język C# to widać, że są plany upodobniania jego składni to ciekawych rozwiązań z F#.

Do zobaczenia w C# 7.0.