# Is this code as weird as I think it is?

Combing through legacy code, I found this:

public static void SetupSiteDeptBox(string siteNo, System.Windows.Forms.ComboBox cbo, ref Hashtable DeptHash)
{
DeptHash.Clear();
if (siteNo != "")
{
cbo.Items.Clear();
. . .
. . .


This method is called from one place, another form (this code is in the main form). Okay, calling the main form may be alright, because it can be counted on to be in existence, but why pass the comboBox from one form to the other? Why not return an ObjectCollection (or ??) instead of void, rather than pass a control from one form to another?

-
Yes, there are many bad programmers out there. I would suggest getting a copy of Reshaper, running StyleCop, and if after that you still feel like the smartest person in the room, then you are in the wrong room. –  Leonid Feb 26 '13 at 1:05

First, I see no reason whatsoever to pass the Hashtable with ref.
Then, as you said, why pass in a ComboBox UI element? Seems like a poor separation of concerns.
Finally, Hashtable should (likely) be replaced with a modern generically-typed Dictionary<K,V>.