In case you missed it, the tech community went through another significant milestone this year. The release of .NET Core 3.0 is a noteworthy advancement and it introduced a lot of new features including a new version of C#. Along with this major release we also learned about the latest and greatest C# 8.0.
C# was always a diverse and universal programming language, and with the latest improvements to it, the programming language continues to have a very promising future.
OUR TEAM’S OPINION
We went ahead and asked our team for their opinion on the newest features and enhancements to the C# language. We have compiled their thoughts and provided some insight into how the modifications may influence your software development projects.
The two clear favorites on our team were Pattern Matching and Asynchronous Streams.
Pattern Matching is possibly the most interesting addition. This feature continues to support functional style programming. It doesn’t allow new things to be coded, but makes the code much more concise and readable.
Asynchronous Streams is an interesting extension of the asynchronous capabilities of the language. This enhancement allows for more functional style programming, allowing all the usual list-management tools to apply to expressions and functions even if they are asynchronous. It will allow asynchronous calls in LINQ statements and loops.
Default interface methods on the surface doesn’t look like much, but one very interesting effect of this is that it allows multiple inheritance. Not supporting this was a controversial decision in the early days of C#. It looks like allowing Xamarin to align more closely with Android and iOS is what finally tipped the scales in favor of this support.
Nullable Reference Types allows the programmer to explicitly state whether a variable should be allowed to be null. Previously all reference types were nullable, and only value types could be so described.
Indices and ranges allow another level of type safety, allowing you to specify the intended use of index variables and to specify ranges directly.
Some minor but impactful changes include:
- Using declarations to create more readable code.
- Null-coalescing assignment is a small improvement in code readability over the old null-coalescing operator.
- Interpolated verbatim strings removes a restriction on the order of tokens.
- Static local functions are aimed at preventing unwanted side-effects.
Unmanaged constructed types will improve interoperability with unmanaged libraries, and stackalloc in nested expressions is, again, for improved code readability.
Our team is always keeping up with the latest technologies and we strive to be at the forefront of innovation. The enhancements that were added to C# are likely to make a positive impact on our software development process and we look forward to building application with the newest tech.