When version 6 of the C# language is on its way to the release, the design process for ver. 7 has started. The notes from the design meeting was released couple of days ago. According to Mads Torgersten’s notes – this was the first design meeting.
We can find there couple very interesting parts about future of the language itself but the consequences of making the .NET open source as well.
Design team is still in charge
This is quite important information from these notes – the design process for C# language is not a democratic process. This means that all that community will suggest will be verified by the team but in the end the governance model for C# is benevolent dictatorship. I personally think that having people responsible for the language is a good choice – with community involvement, the language can gain more than it used to be.
The dictatorship does not mean that team will not listen to the community – as the write in notes, they are open for other ideas and suggestions. We must also remember that the day is limited to 24 hours so not all ideas will be verified at the same level.
New version parts (aka themes)
Team has prepared areas on which they want to focus during next version design process. But this is also important that they are willing to add a feature whether it fits in a theme or not.
Working with data
The volume of data in our applications is growing. We can see that more and more interest is focused on functional programming. We have LINQ which is functional-kind-of in the C# language. The design team will investigate further the possibilities to add more features to make working with data much more plesant and easy. They mentioned couple of areas they will investigate – such as pattern matching, immutability, tuples and many other.
Performance and reliability
C# and .NET have areas where the performance and reliability are not the best. There are research projects inside Microsoft which focus on that topic, especially the connection with unmanaged code – the team will investigate this and decide how C# 7 and .NET Framework will be supplemented.
This area would probably not influence language itself but they want to be sure that change how .NET programs are factored and combined could be done.
We got async-await in C# 5 for single values – but the area for sequences should be explored. They are also into serialization topic for C#7 – which is quite interesting, as they write “we may no longer be into directly providing built-in serialization“.
They are aware that for some reasons in enterprise applications developers are forced to generate code based on some constraints or values from other files. There are areas and ideas to reduce the need to generate code (i.e. virtual extension methods, static ctor constraints, default interface implementations). We may see some of these features in next C# version.
In we will (we got? 🙂 ) get null-conditional operator (x?.Sth) but there are some some more places where such features could be added (i.e. null in foreach statement).
They are also considering non-nullable reference types – which they see as very hard to fully support.
There are number of other not so big feature which are also considered to be implemented/added to version 7.
New version features
Mads makes great effort to fully describe features considered for new version of C# – I think there is no better way as if just read this section from his post. In a nutshell they are interested in:
1. Pattern matching – especially making is operator more powerful, and making case in switch statement more pattern-like than just simple values matching.
2. Array Slices – there is ArraySegment<T> as mentioned in comments but these would be a little bit more language support. This basically mean that the arrays would be better divided into “windows” which could provide us better performance.
3. ref locals and ref returns – this got me thinking that using this is going be not so easy. They are aware that assignment to the getter-only property with ref value – this would create nightmare. They are considering this feature with lots of conditions and explanation how and when use it.
4. Method contracts – we have CodeContracts but there is no language support. What is more important, the runtime has pre- and postconditions for methods – they are considering adding this into the language.
This is fast! We are waiting for C# 6 release – and we hear about version 7. I expect more information from them as they progress with the design and they will start making decisions. What is more important – they expect us, developers to take part and post ideas on GitHub. The voting system will be used so other developers will have possibility to show which features are more important for real-life applications.