|
|
|
I wouldn't say that the problem with monkey-patching is compability with the libraries you patch.
The problem is how hard it becomes for other developers to understand your code when you start modifying things in one module in another.
Simon |
06/07/04 - 12:28 pm | #
|
|
But if you're adding a useful and clearly named method that is only called in your own code, how is this less readable ?
Fuzzyman |
Homepage |
06/07/06 - 8:43 pm | #
|
|
It has too many non-local effects. You can't predict what the behavior will be.
What if two people add a method with the same name?
What if code uses hasattr tests to determine how to treat an object suddenly starts getting the opposite result?
Even "full unit test coverage" doesn't help here. What you need to make sure this doesn't break you app is full integration test coverage, and I have never seen any project that came even remotely close to having this.
Anonymous |
06/07/10 - 1:27 pm | #
|
|
|
Commenting by HaloScan
|