3 ms·
Atwood seems to equivocate between "monkey patching," "monkey patching built in classes like String," and "metaprogramming." There are good reasons to be caref
by cia_plant 18y ago
Atwood seems to equivocate between "monkey patching," "monkey patching built in classes like String," and "metaprogramming."
There are good reasons to be careful of monkey-patching, especially monkey-patching of built in classes, but they are essentially identical to the reasons that you want to be careful of all global state. There are other forms of metaprogramming, such as macros or templates, which are more local and safe.
I guess the real issue is between "make potentially bad choices annoying and difficult to use, so that programmers feel bad about using them," versus "support all programming as well as possible, trusting the programmer to avoid bad patterns." I think that the latter attitude is more realistic: a determined bad programmer can write bad code even in Haskell or Ada or Java, and sometimes those "bad" patterns are useful (e.g., gotos are a great way to write a DFA).