This is code-related as in what the compiler will allow you to do in one language, but not allow you to do in another language (e.g. optional parameters in
One of the overlooked or simply misunderstood features of the VB language is calling a function which has a ByRef
parameter. Most languages support only a single method of passing parameters by reference: that is the scenarios directly supported by the CLR.
The CLR has a lot of restrictions on the type of values it supports for ByRef
parameters and these restrictions get in the way of VB’s goal to be a flexible language. Hence the compiler goes to great lengths to be flexible and support multiple avenues of ByRef
passing, much beyond what the CLR natively allows.
C# 4 now supports two versions of reference passing. In addition to the one available since 1.0 the ref
modifier is now optional when making an interop call to a COM object.