3 ms·
"Nor is this a problem that scales with community size." - The more people you have writing libraries, the more monkeypatches are made in a library, the more li
by jerf 18y ago
"Nor is this a problem that scales with community size." - The more people you have writing libraries, the more monkeypatches are made in a library, the more likely it is that the monkeypatches will collide. That's so obvious I don't even know how to argue for it.
"Granted Ruby's ability to reopen classes anywhere it likes makes this problem more difficult, but i hardly see this as an indictment of any use of the language."
I do, because other languages manage to provide features and libraries without causing this problem. A problem that is unique to the monkeypatching languages (also Javascript) can be laid at the feet of the design decision to permit it and the community decision to roll in it.
If the community is indeed walking away from monkeypatching.... that doesn't prove I'm wrong, it proves I am and was right about the dangers involved. I don't feel inclined to give the community much credit for coming around to the realization that unfettered monkeypatching is a bad idea two years later than I did.
If you like monkeypatching, you should be listening to Raganwald. He's looking for a way to reap the benefits without paying the price, and I think such a thing could be constructed.
Version control is a separate problem indeed. It should be pointed out that I was responding not directly to the original topic, but the posts that are the parent in this chain. This is perfectly valid.
Oh, and stuff it with the trolling accusation. I'm not looking for flaming responses, I'm hoping to safe someone from stepping into the monkeypatching tarpit that at least historically the Ruby community has advocated so hard for people to leap into. Again, if the community is walking away from that tarpit too, are they "trolling" when they do that? Trolling means something, and it isn't "having strong opinions with reasons given".
- aaronblohowiak 18y agoThis is not a monkeypatching problem, per se. It is a problem of scope-independent class definition. There are languages wherin you can monkeypatch the class definition (or the definition of a single instantiation of a class) wherin those patches only are in effect in certain contexts.. so you have a scope to your monkeypatching. I think that this would allow for Interesting Things, while being "safe".
- catch23 18y agoSometimes monkey patching is good actually. I use Soap4r all the time, and I preferred the debug xml to appear in the console rather than created as a separate file, it was really easy to make a monkey patch that fixed this, without modifying the actual distribution... that way other projects wouldn't be affected. Another time, there was a small bug in Hpricot, rather than fix it directly in source, I patched it in my code, and removed the patch when the fix was in the production stream. At least it's nice to have that option available...
- knowtheory 18y agoWhatever dude, you're not being fair. Particularly with claims like: "If the community is indeed walking away from monkeypatching.... that doesn't prove I'm wrong, it proves I am and was right about the dangers involved. I don't feel inclined to give the community much credit for coming around to the realization that unfettered monkeypatching is a bad idea two years later than I did." So "the community" (whoever they are) doesn't move as fast as you do. What have you done to change it? There are people who are out there trying to make things better. Not simply painting everyone with the same brush and then writing them off. Fine, you've got a problem with the way people use Monkey patching. You should convince people of the dangers of using it. You're not succeeding. Monkey patching itself isn't the problem. The problem is not writing portable code. ============================ Incidentally i find it extraordinarily frustrating that there are clearly a lot of people who down mod anyone who says anything positive about Ruby (since i can watch my points increase shortly after posting them, only to fall back to basically 1 or zero as time progresses, regardless of the content of my posts).