In the modern age of web applications and development, it seems we are constantly adding side effects to every part of our applications - everything from analytics to event triggering. Unfortunately in a lot of cases, we tend to cram this functionality into function with the useful stuff. As programmers, this causes numerous issues down the line - especially when it comes to refactoring and code comprehensibility.
A simple way to keep this functionality apart from the core code is create a helpful utility function to manage it for you. And to keep our code readability, we shouldn’t allow anything advanced that can break our understanding of the original function. That means we don’t want to be able to alter the original function, but we can still trigger any side effects we need to inline with the original function.
Your new post is loading...