Skip to main content

Monkey Patch - a Band-Aid for code?

Yesterday Chad Fowler made a post about the virtues of monkey patching. It mentioned that his code "monkey patches some of the Rails core classes" but does not provided a definition. It wasn't something that I had heard of before so I went in search for answers.

I found it within the documentation section of Plone.org (an open source content management system). Their definition is:
A monkey patch is a way to modify the behaviour of Zope or a Product without altering the original code. Useful for fixes that have to live alongside the original code for a while, like security hotfixes, behavioural changes, etc. The term "monkey patch" seems to have originated as follows: First it was "guerilla patch", referring to code that sneakily changes other code at runtime without any rules. In Zope 2, sometimes these patches engage in battle with each other. This term went around Zope Corporation for a while. People heard it as "gorilla patch", though, since the two words sound very much alike, and the word gorilla is heard more often. So, when someone created a guerilla patch very carefully and tried to avoid any battles, they tried to make it sound less forceful by calling it a monkey patch. The term stuck.
You learn something new each day don't you! So is that why GreaseMonkey is called what it is?

Technorati Tags: , ,

Comments