I am going through the well-known Structure and Interpretation of Computer Programs book and come across a mention about add_action.
This immediately brought my attention as WordPress has a similar concept called hooks (add_action and add_filter). Section 3.3.4 of the book gave an example of how this concept is deployed, which is simple but brings a lot of flexibility to the system.
Such an enlightened and connected feeling!