The Case Against Monkey Patching, From a Rails Core Team Member (2023)

If you’re new to Ruby, you might not be familiar with monkey patching because some other languages make it difficult to change the behavior of existing code. A monkey patch is code that dynamically alters the behavior of existing objects, typically ones outside of the current program. Often applications that have monkey patches are changing the behavior of the Rails framework or another gem, but I’ve also seen applications that monkey patch themselves which doesn’t quite make sense since monkey patches are global. When I say monkey patch, I mean something more broad than just extending an existing class. In my opinion, a monkey patch is any time you change the behavior of the underlying library in a surprising way. Let’s look at an open source example of this to get a better idea of what I mean.
The Case Against Monkey Patching, From a Rails Core Team Member (2023) #ruby #rubydeveloper #rubyonrails https://rubyonrails.ba/single/the-case-against-monkey-patching-from-a-rails-core-team-member-2023

Nezir Zahirovic

Contractor Ruby On Rails (8+ years) / MCPD .Net / C# / Asp.Net / CSS / SQL / (11 years)

related articles