3 ms·
Ever encountered code where you have to load 2 modules in a particular order or else they don’t work? Or maybe you didn’t figure out why a module that works fi
by btilly 7y ago
Ever encountered code where you have to load 2 modules in a particular order or else they don’t work? Or maybe you didn’t figure out why a module that works fine for others doesn’t for you.
Monkey patching is one of the top causes of that. And is part of why Ruby projects tend not to scale in complexity as well as Python.
- joelbluminator 7y agoIt's quite rare to be honest, so no. And I've been doing Ruby for a long time. It's not like every Ruby developer out there tries to monkey patch esoteric things just to confuse the enemy. And again, monkey patching is possible in every dynamic language.
- joelbluminator 7y agoI"ve seen a developer break 20000 websites at once because he monkey patched a jquery method in a widget our company built, so lets not make this out to be a Ruby thing.
- btilly 7y agoIf it is rare, then I must be unlucky. Because I'm not a Ruby developer, but I have had to help people diagnose exactly that problem more than once.