-1

EDIT The original title of the question was Is there a non-derogatory term for 'monkey patching'. As I have learned that the term is actually not derogatory, or is at least not meant to be, I changed the name to free it from mistaken implications.


I would like to describe a piece of software, and try not to use emotionally biased language. However I am not aware of an unbiased alternative to 'monkey patching'.

The term is meant to be derogatory for a reason. Many see it as a useful but problematic technique.

I am aware of an alternative, but it is equally derogatory: 'duck punching'.

I see 'open classes' not as an alternative name, but as a prerequisite for monkey patching.

'Overriding' does not seem right either. I would like to differentiate between monkey patching and the regular overriding as part of inheritance-based polymorphism.

closed as primarily opinion-based by amon, Martijn Pieters, gnat, World Engineer Apr 15 '14 at 14:14

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Did you study the history of the term at all? I fail to see how it was meant to be derogatory. I should know, I was there when the term came into use. – Martijn Pieters Apr 15 '14 at 9:29
  • But runtime patching is the 'technical' term. – Martijn Pieters Apr 15 '14 at 9:31
  • Yes, I did. 'Changing the code sneakily and and possibly incompatibly with other such patches'. The meaning of 'Guerilla', the term used before 'monkey' stands for a small war, or an asymmetric armed conflict. Further, I have seen the term 'monkey patching' used in a derogatory context. This is how I came to my impression. – kostja Apr 15 '14 at 9:38
  • 2
    Only the last part actually applies to the term monkey patching. Which was a joke, based on someone mistakenly hearing Gorilla where Guerrilla was meant. I can assure you emphatically that the term was never meant in any other way than to convey gentleness over brute force. If you read the term as derogatory, that's you bringing in your own context. – Martijn Pieters Apr 15 '14 at 9:51
  • 1
    A monkey patch is a Guerrilla patch that takes care not to step on the toes of other patches, see plone.org/documentation/glossary/monkeypatch – Martijn Pieters Apr 15 '14 at 9:53
7

As someone who was actually working at Zope Corporation (then still called Digital Creations) when the term came into being, I can emphatically state it is very much not derogatory.

The term is a tongue-in-cheek reference to runtime patching (or dynamic patching, if you will).

We talked about sneaking in and altering Python code at runtime; the term Guerrilla Patching was used because sometimes dynamic patches could interfere and conflict. Conflict -> Guerrilla warfare, as the conflict was dynamic and depended on the terrain.

Then someone who had misheard the term and thought it was Gorrilla Patching, had come up with a way to wrap a method and re-use it in their dynamic patch. This meant that even if the method had already been patched, you would not undo that work. Because this was a gentler, more caring form of patching, he used the name Monkey Patch instead. The name stuck as it spread through the wider Python community.

If you feel you cannot use terms like that because they have too many other connotations for you, then so be it.

The technical, colorless and humorless version you are looking for is dynamic runtime patching.

  • I have found a source of my misconception about 'monkey patching' being derogatory from the start: devblog.avdi.org/2008/02/23/…. At least I am not alone with it. – kostja Apr 15 '14 at 16:00
  • All references I can find come from the Ruby community, that blog post being the oldest reference. If that is the source of the idea that monkey patching is derogatory, then he really misunderstood something. And in that context, it was the patching itself that was deemed derogatory; not the term. – Martijn Pieters Apr 15 '14 at 16:06
  • Sure, it's just too easy to misinterpret names. That's why I prefer them 'colorless and humorless'. Makes them context-free. – kostja Apr 15 '14 at 16:15

Not the answer you're looking for? Browse other questions tagged or ask your own question.