3 ms·
Non-Ruby user here. I thought monkeypatching was replacing members at runtime, not just adding them. Or adding them to an instance of the object instead of the
by MichaelGG 16y ago
Non-Ruby user here. I thought monkeypatching was replacing members at runtime, not just adding them. Or adding them to an instance of the object instead of the class.
Isn't just adding members like a "type extension" that statically typed languages can safely do? (Not flaming, just trying to understand the differences.)
- awj 16y agoThat actually is (sort of) addressed in the article's initial example. Your class extension can turn someone else's class extension into a monkey patch. Worse, your extension may not match calling semantics of the other extension, so you can get some truly ugly behavior.