Bad Design

Passing parameters by reference is a sign that you don’t have the relationships between your functions correct. To try to decide what constitutes a function, I think of the mathematical definition. The mathematical model of a function is of the form:

x = f (a,b,c,)

where the function acts on a,b,c, and so on to produce a result x. Both sides of the equal sign are the same value. You can use either x or f(a,b,c…) interchangeably.

In a Visual Basic program, this is not quite the case because the function does something as well, but it is still most useful to think of the return value x as the result of what that function f does. But if x contains the result, the result cannot be also in a,b, or c. In other words, only x is changed by the function. This is my simplistic conceptual model of a function, and it is at odds with the notion of passing by reference.

Passing a parameter by reference indicates one of the following: