Skip to main content

Questions tagged [monkey-patch]

Filter by
Sorted by
Tagged with
3 votes
3 answers
877 views

Is this a good use of monkey patching?

I have a set of data-struct like classes that correspond to the JSON messages being exchanged between services in an overall architecture. By struct like, I mean these classes just have fields -- no ...
Dave's user avatar
  • 262
0 votes
2 answers
553 views

What is the best practice for temporarily pairing an attribute with a class

Consider a case, in which a class needs an attribute only in a very limited context. (For example, only during initialization, which is handled by a factory) I do not want to include such an attribute ...
Ali Rasim Kocal's user avatar
0 votes
1 answer
3k views

Add method to existing class you don't own in javascript

Is it still called monkey patching if you are only adding new methods instead of changing existing method behavior? What is this called? Example: String.prototype.contains = function(needle) { ...
still_dreaming_1's user avatar
-1 votes
1 answer
1k views

Is there a purely technical term for 'monkey patching' [closed]

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 ...
kostja's user avatar
  • 419
-1 votes
1 answer
810 views

Code design: is this specific case of monkeypatching in python acceptable?

I'm using python to do some research tasks. I have a class hierarchy for "tools", where each object is an instance of a particular tool. They all share some functionality and have many similarities in ...
Greg Kramida's user avatar
16 votes
5 answers
7k views

Is monkeypatching considered good programming practice?

I've been under impression, that monkeypatching is more in quick and dirty hack category, rather than standard, good programming practice. While I'd used from time to time to fix minor issues with 3rd ...
vartec's user avatar
  • 20.8k