In What’s in a name? (C#’s hidden support for structural typing) we explored a few of the areas in which C# currently supports structural typing. I would like to propose two new additions to C#’s structural typing abilities: implicit interface inheritance and richer generic constraints. Implicit interface inheritance I propose that class or struct ought [...]
Monthly Archives: April 2010
Two structural additions to C#
28-Apr-10C# is well known for its nominative type system. This means that C# identifies types and their relationships based on their names. That is why C# does not allow you to create two types with the same name, even if they have a different public interface – the C# compiler only cares about the name [...]
Choosy developers choose interfaces
23-Apr-10Each time you write a parametrized method you must decide which are the best types to use for your parameters. If you are not careful, your choice could place unnecessary restrictions on the caller of the method that requires them to pass too specific of a type. When you are making this decision you should [...]