Helper is a commonly used name appendage.
However, it communicates very little about what it does. Every time I have seen it used I have found it to be a suboptimal name.
In fact I consider it to be a code smell that indicates more problems underneath.
Example
Suppose we see the name "WidgetHelper" (here "widget" is a stand-in name for any sort of programmable functionality, and not necessarily a UI widget):
class WidgetHelper:
...
What do we learn from the name? We know the object or function does some kind of work secondary to the widget. It is my experience that this might not even actually be true, and one might delete "helper" from the name and improve the communication.
For another possibility, "WidgetHelper" could be wrapping the widget, such that the widget code itself may know nothing about the helper. The implication is that WidgetHelper
in this pseudocode example is part of the public API:
class WidgetHelper:
def __init__(self):
self.widget = Widget()
...
In this case, something like "WidgetAPI" would be a better name, because that, at least, informs the user its relationship to the Widget class. Or perhaps we delete "Helper" from the name and additionally rename Widget
to something like WidgetImplementation
.
Alternatively, it could be wrapped and called by the widget, implying it is not part of the public API, but rather part of the implementation details.
class Widget:
def __init__(self):
self.widget_helper = WidgetHelper()
...
Even in this case, with this small amount of information we have an improvement on "helper." It would be more descriptive to call it some generic name like "WidgetImplementation."
"Implementation" may be correct as the implementation may do too much to give it a more precise name. Or it may itself be too vague - this is at the discretion of the namer.
But as we have seen, the name, "helper," doesn't aid in understanding what is going on in the code, other than it is ancillary to the main object of interest. "Helper," could mean many kinds of relationships. Thus, it is overly vague and nebulous, and not well-suited for the purpose of informing the user what the object does.
Conclusion
Naming things is one of the hard problems in computer science.
What is desirable in a name is that it inform the user what the named thing is supposed to do.
But in any case imaginable, it would be more descriptive to use a name other than "helper" or simply remove it altogether.
As a corollary to my experience and this discussion, the choice of "helper" in a name also signals low effort or sophistication on the part of the namer (correctly or not). It is, indeed, a code smell.
Please don't call anything a "helper."