3 ms·
This is what happens when you use monkey patching (ie. overwriting the builtins of a language/library). Unfortunately, it's a very common technique in the JS Wo
by mherrmann 8y ago
This is what happens when you use monkey patching (ie. overwriting the builtins of a language/library). Unfortunately, it's a very common technique in the JS World. It's sad that so much of modern development (JavaScript) is based on such bad practices. Just because it's easy doesn't mean people should do it. Touching globals is almost never a good idea.
- bsimpson 8y agoYour comment is missing its [2011] tag.
- mherrmann 8y agoSmooshGate is the best example that it's still an issue. [2018]
- olavk 8y agoMonkey patching is also what allows polyfills, which are one of the things which allow the web to move forward. So I would say it is more of a double-edged sword than an all-around bad practice.
- mherrmann 8y agoI agree that there are cases where monkey patching makes sense (or is the only way forward). As usual, it depends on the context. It just shouldn't be something that's done lightly imho.
- alanfranzoni 8y agoMonkey patching for backporting can be fine. But, monkeypatching to add arbitrary functionality? Totally unneeded.