I recently picked up 'Clean Code' by Robert Martin and have taken to refactoring my recent project. I'm realizing how important it is to name variables and functions in a way that clearly expresses their intent.
One of my functions is called addEvent(). But the problem is, this function sometimes adds 1 event and sometimes adds multiple events, depending on the arguments it's given.
I'm trying to come up with a suitable name for this function but nothing really sounds right to me:
I'm also aware that a function is only supposed to do one thing. So maybe I need to break this up into more than one function? But in that case, I can't think of what the function that determines how many events to add would be called!