DEV Community

Discussion on: Monkey patching: What is it and should you be using it?

Collapse
 
matthijsewoud profile image
⚡️

I think it’s easy to stumble in to monkey patching. I remember building a WordPress template once, and I couldn’t figure out how to change something specific — something that wasn’t immediately obvious from googling. A senior recommended I just search all the files in the source code for the string that made it up, and change it. I was just a junior, but it felt dirty to wrestle in the source code, even though I didn’t have any idea of how to accomplish the thing I wanted.

Of course nowadays I realize there’s a hook in WordPress for nearly everything.

Collapse
 
napoleon039 profile image
Nihar Raote

Yep, that can be a bit overwhelming if you're not used to it. Sifting through a ton of code for a specific thing is too much for those doing it for the first time.