Why Patching Globals Is Harmful – kettanaito.com

May 17, 2024

Honestly, I’d never thought I’d be writing about this, but the matter of patching globals turned out to be one of those topics that a lot of engineers seem to misunderstand. Most of us don’t do monkey-patching, and even fewer stay around those implementations long enough to witness their impact. All the more reason to talk about it.

Throughout the next few thousand words, I will be referring to modifications of global APIs as “patching”. You take the code you don’t own, you modify its behavior, you patch it. I hope we are clear on semantics.

Source: Why Patching Globals Is Harmful – kettanaito.com

Next time you’re tempted to modify global APIs, think of this article and don’t.