Hacker News new | ask | show | jobs
by Loeffelmaenn 1623 days ago
Why wouldn't the just use the params [0] keyword for stuff like this?

[0]: https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...

3 comments

Because this is an OLE 2.0 library for Office automation.
My humble guess is that it didn't exist when this was designed?
This looks like the interop libraries auto generated off the Office OLE Automation interfaces. SafeArrays should have existed back then. I imagine this was used instead for perceived developer friendliness vs forcing developers to box up and create a Safe Array to marshall in (more boilerplate).
Don't think it works in this case. In general why there are so many overloads in C# with parameters like arg0, arg1, arg2 and so on is because of the poor performance of the params solution for value types.