Hacker News new | ask | show | jobs
by Lio 1037 days ago
> Monkey patching comes from Ruby, since classes are open, you can change implementations at runtime.

Monkey patching is a feature common to many languages including Python, it did not originate in Ruby.

If I was having a punt I'd say it probably originates in Smalltalk or Lisp.

2 comments

> Apparently from earlier guerilla patch (“code that sneakily changes other code”), understood as gorilla patch. A monkey patch was then a more carefully written instance of such a patch.[1] Or simply derived from monkey (“to mess with”, verb).

Wiktionnary

Certainly not in Lisp; I have never heard it before; I thought Op made it up :); but have looked it up on Wikipedia and indeed is a term. Seems just to alter the behavior at the runtime.