Skip to content

Month: January 2019

C# Interfaces and default method implementations

The upcoming C# 8.0 release came up the other day, or more specifically the inclusion of default implementations on interface methods. At first glance it seems akin to madness, blurring the line between implementation and inheritance. We already have abstract classes that cater for this, so why the need? Taking a little time to dig a little deeper though, and I think it does make sense and could be extremely powerful. The caveat being that it isn’t abused, which it most certainly could be. Using it looks to be pretty straight forward. You simply provide a method body on the…