Naming of overloaded methods - singular or plural? [closed]

Let's say I have an object Basket that store various items in some private property (Basket._items). Now, I want to have a couple of methods for adding, removing and getting items.

Each method can take either a single item or a list of items as an argument, or with no arguments, in the case of removing and getting, may remove or return all items.

How do you think I should name my methods?

addItem or addItems
removeItem or removeItems
getItem or getItems

(They don't all have to be the same form; for instance, maybe only the last one should be plural.)

-

closed as off topic by Glenn Rogers, Paul, Brian Reichle, Jeff Vanzella, YannisOct 5 '12 at 20:08

Questions on Code Review Stack Exchange are expected to relate to code review request within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

If the methods add, get and remove multiple items, I'd use a plural. I think it's more obvious that addItems can add one item than addItem can add multiple items.

In any case, good documentation is your ally. :-)

-
Unfortunately, the Basket object does hold other things. I guess using both is an option - but wouldn't you say it goes against the conventions of jQuery, just to give an example? Also, when adhering to the DRY principle, both functions would delegate to the same body of code, which might seem clumsy. –  dalgard Oct 4 '12 at 3:21