Helper Function

Functions have two main purposes: aiding code reusability and breaking down a task into smaller logical units. Functions that do not aid code reusability are helper functions; their sole purpose is to "help" a single function by cleaning the code and making the logic clearer. The opposite of a helper function is a library function, which focuses on code reuse.

Helper functions are often very concrete as each one is used in a small section of code. On the other hand, library functions are very abstract, allowing them to be used in multiple projects.

If a function is only used a single time, it is probably a helper function.

From the below quote, it appears that what I call a library function, others call a helper function. -Michael Lombardi

From AreLongAndDescriptiveRelated: In my book, a function that is called more than ten times in a program is almost certainly a "helper" function.) I and my friend, we do not, because the longer the names of "helper" functions are, the less they "help"...

The HelperIsaCodeSmell page may provide some insight.


EditText of this page (last edited January 29, 2010) or FindPage with title or text search