Meet C# 8 and learn the future of C# by watching the following videos from NDC London 2019.
The State of C# - What Have I missed?
The first video goes through the history of C# and describe the major features introduced in each version including some of the latest versions. I totally agree with the speaker that C# is effectively the best of all worlds: declarative, imperative and functional.
Much ado about Nothing - Act I and II
The next two videos explore the major features introduced in C# 8 by writing examples.
They use an implementation of a linked list to describe how you can make nullable references explicit in your code. It also mention that for new code, using pattern matching could be the best option to reduce the number of warnings and make your compiler happy. However, Microsoft implemented complex flow analysis to help the compiler understand common legacy null reference checkes and avoid showing false-positive warnings.
You can always tell the compiler to be quite and ignore a warning using the "damn it" operator that probably will be called differently once the language version is finalized.
The second example shows how to build a survey simulator from scratch to describe how the design process change when using non-nullable reference types in C# 8.
The most important questions you should ask while designing are:
- Should this variable be null?
- Should this variable never be null?
Then let the compiler help you to make your design decision more explicit and verify the decision is preserved in your code base.
Where is C# Headed?
The next video, start with a exploration of non-nullable reference types and explore other new features coming up in C# 8 like switch expressions, advanced pattern matching, indexes and ranges, async enumerable and default interface members. It also explore some of the features planned for later versions of C# like record types (can't wait for them) and more compact way of initializing new objects.
The promise of an async future awaits
This talk explores how you can use async/await correctly to make your C# code asynchronous. It nicely describe a pattern to compose tasks using async methods that should be used instead of manually creating continuations.
Panel discussion on the future of .NET
The last video is more of a discussion on the most exiting things happening in the .NET ecosystem like the ability to run Windows Forms and WPF on .NET Core 3, machine learning in C# and running C# in the browser.
I love how Mads finished off saying that we can end the Javascript monopoly in the browser thanks to blazor and web assembly technology. It's fine for Javascript to keep running but side by side with the rest of us 🙂
The future of .NET and C# is bright and amazing.
Want to stay on top of .NET and master C# software development?
Join the productive C# membership
If you liked the post, please share it with your friends and colleagues.