Right.. I was just thinking about that. The failovers are going to get me if I don't prep for them now. Things like battle-ground specific food/bandages, or conjured items. There are a few ideas that I'll play with, maybe I'll end up with one I like.
To me.. pickAndUseBandage() is the same as pickAndUse(bandage), but I can see your point of view on that.
Breaking it up by process might help as well. Really, the only main one is target or no target. Everything checks /something/ (which I have stashed in another subroutine anyway.)... ooo.. unless i want to add buff-food.. and check to see if it has that buff already.. hrm... something to consider.
I've been toying with my first add-on, a bandage/potion/food/drink chooser, and had a question about function efficiency. (BestInShow on the SVN. Warning, it's scary to look at right now.)
Tekkub tossed up 'PotHead' on the SVN, in which every item type has it's own function. I've been building on the concept that, as the process is the mostly the same, it can be a single function. However, that leaves me with conditionals as I sort out the differences. (Bandages can be applied to target, some items check health, others mana, etc.)
In the interest of making things as tight as possible, are there good guidlines on where someone should draw the line when it comes to conditionals versus seperate functions?