Calling a procedure with argument variables whose names match the procedure parameter names but in a different order can cause confusion. It could
indicate a mistake in the arguments' order, leading to unexpected results.
Public Function Divide(divisor As Integer, dividend As Integer) As Double
Return divisor / dividend
End Function
Public Sub DoTheThing()
Dim divisor = 15
Dim dividend = 5
Dim result = Divide(dividend, divisor) ' Noncompliant: arguments' order doesn't match their respective parameter names
'...
End Sub
However, matching the procedure parameters' order contributes to clearer and more readable code:
Public Function Divide(divisor As Integer, dividend As Integer) As Double
Return divisor / dividend
End Function
Public Sub DoTheThing()
Dim divisor = 15
Dim dividend = 5
Dim result = Divide(divisor, dividend) ' Compliant
'...
End Sub