Responsible Monkeypatching in Ruby
Can someone help me understand why anyone would ever rely on monkeypatching in non-test code?<p>Python is just as dynamic as Ruby in a lot of ways. But in Python, overwriting an existing and important&#x2F;fundamental&#x2F;ubiquitous method would be an absolute last resort when all other sensible approaches have failed. And in that case you would at least have the sense to save the original method somewhere under a different name.<p>What makes such a horrifying idea so apparently not-horrifying in Ruby? The ability to &quot;reopen&quot; class?<p>None of the examples in the blog post seemed like such dire circumstances as to require it. Maybe replacing a buggy method while you wait for a PR and new release is a valid use case. But the failure mode is also particularly nasty.