X

New features in C# 8.0

Deep-dive posts to new features in C# 8.0: default implementations in interfaces, using-declarations.

C# 8: Default implementations in interfaces

C# 8.0 will introduce new language feature – default implementations of interface members. It means that we can define body to interface member and implementing class that doesn’t implement given interface member will use default one from interface itself. Here’s my deep-dive and analyzis to default implementions of interfaces.

Using-declarations in C# 8.0

One of new language features of C# 8.0 is support for using declarations. These declarations enable shorter syntax for declaring disposable variables we want to dispose. Also using declarations give us a little bit cleaner code while compiler makes a dirty work of producing correct code that takes care of disposing disposable variables.