Story. This goes back to the earliest days of .NET when COM ruled the world. The ability to interact with COM was very important then, no one ever drops everything to adopt a completely new programming style.
What made COM interoperability strongly supported in .NET in general. In addition to having named arguments for interface methods, they require type libraries.
An interesting corner case forever is the C ++ / CLI language. He adopted many C ++ syntax rules, including the ability to omit parameter names in declarations. In other words, this is legal:
public interface class IFoo { void bar(int, long, double); };
An exporter of the type library generates this declaration:
HRESULT bar( [in] long p1, [in] long p2, [in] double p3);
A very similar result if you implement an interface in a C # class, as IntelliSense autogenerates:
class FooImpl : cpptemp36.IFoo { public void foo(int __p1, int __p2, double __p3) { throw new NotImplementedException(); } }
This does not please anyone.
Hans Passant Sep 05 2018-12-12T00: 00Z
source share