Meant by the term “hook” in programming

hook

I recently heard the term "hook" while talking to some people about a program I was writing. I'm unsure exactly what this term implies although I inferred from the conversation that a hook is a type of function. I searched for a definition but was unable to find a good answer. Would someone be able to give me an idea of what this term generally means and perhaps a small example to illustrate the definition?

Best Answer

Essentially it's a place in code that allows you to tap in to a module to either provide different behavior or to react when something happens.