There is a lot of history behind this issue, this refers to 1997, when Microsoft released the COM Automation specification. Which allowed property developers / receivers to have arguments. Visual Basic was an early adopter of the specification; it was largely modified by the language to find a replacement for the VBX extension model. During this time, he had no gas; he depended heavily on the 16-bit coding model.
The C # team took a rather ridiculous attitude towards this function, they are incompatible with the synchronism of hate syntax. It just doesn’t apply to a completely new language. VB.NET didn’t have the same luxury; they had to at least support some functions of the previous generation, VB6 at that time.
Going forward 10 years, the C # team had to practice a bit on popular demand. Indexed properties are common, for example, in the Office object model. In C # 4, they allowed indexed properties exclusively for COM interfaces to alleviate the pain of writing C # Office code. And yet, additional and named arguments have also been added to deal with the sadness of Type.Missing. And a dynamic keyword to support late binding, another important COM and Visual Basic feature that was very painful in C # without this keyword.
In short, COM is beautiful, IUnknown's elegance is impeccable. Tony Williams is the genius behind him. The video here is worth a look. A subset of COM Automation, IDispatch, is not so pretty. But it was incredibly successful. Languages ignore this at their own peril and risk. C # - no.
These details may sound secret from a bygone era, but it is not. The next version of the Windows API, WinRT is completely based on IUnknown. Otherwise, it is known as the Metro or Modern Interface. IDispatch not saved, replaced with IInpectable.
Hans passant
source share