#280 – October 13, 2019
Get 40% off your Manning order
C# is an amazing language that's up to any challenge you can throw at it. With 40% off your entire order, including books covering all aspects of C# development, written by experts and legends like Jon Skeet, you're sure to find what you need to become a better developer with Manning!
Non-nullable references with C# 8 and .NET Core 3.0
Two weeks ago .NET Core 3.0 was officially published. Together with the new framework version, Visual Studio 2019 got support for a long-awaited C# 8.0. The complete list of the new language features is available on the MSDN, but the one that deserves special attention is Nullable reference types. This is a very important change in the language semantic, because from now we will be able to eliminate certain class of errors related to reference `nullability` on the compilation stage. In this blog post, I will show you how to use this new language feature and how to achieve similar benefits if you still cannot use .NET Core 3.0 in your projects.
What's the maximum number of generic parameters for a class in C#
Pretty stupid question, right? Because if it’s more than, say, 20 or 100, it’s enough. But still. Where is the limit? We can look at this in, at least, two ways. First is obviously what the runtime is willing to load and the other is what Roslyn is able to compile. And there’s a good chance, that these two limits are the same.
C# is (mostly) a strongly typed programming language. It's type system supports generics, inference, and method overloading. Combining these features, any C# compiler can easily be knocked out. This blog article demonstrates a few approaches. One of them knocks out the programmer more than the compiler, but that's not so important.
C# 8 Interfaces: Dangerous Assumptions in Default Implementation
One of the features that is being promoted about C# 8 interfaces is that we can add members to an interface without breaking existing implementers. But we can cause a lot of pain if we aren't careful. Let's look at some code that makes bad assumptions so that we can understand the importance of avoiding these problems.
6 lesser-known features of C# that you should be using
This post is going to setup 6 features of the .NET Framework which I feel are under-utilised by a lot of developers – your opinion on whether they are under-utilised may differ from mine, but I hope some of you will find this post useful.