A programmer, let’s call him Jehosaphat, wrote a method.
This method was intended to decide in trials whether Side A was right or Side B of any given case.
public WinningSide Decide(Side sideA, Side sideB)
Pretty awesome, eh?
Anyway, Jehosaphat decided that he wanted to be able to use Decide even if only one of the sides was present at the time of the trial. What he did was check in the method’s body whether sideA or sideB was null and returned a value accordingly.
He even wrote in the method’s documentation that either side could be null. What a hard working lad.
I’ve come to see this sort of behavior especially in Ex-VB6 writers. This is wrong. If you are reading this, never do this sort of thing unless both parameters come from an uncontrolled source (such as user input).
What you should do is create an overload for the method such as this one:
public WinningSide Decide(Side presentSide)
So that the person reading it would know that they can use only one parameter as well as two. Better readability. Better maintainability.