Ian Bicking: the old part of his blog

Re: There's so much more than Rails

If you hate monkey patching then you must really hate languages that are prototype-based like Self, Io, Slate, Javascript etc because essentially the basis of these languages is monkey patching. In fact in a langauge like Io the only possible way to program is to do monkey patching. There are no classes. All you do is copy objects and then add methods to them to create new objects.

Comment on There's so much more than Rails
by assman


I think the above comment on prototypes is spot on.

Ruby is, for the most part, a prototype language hiding behind a little class based sugar. The sooner you realize this and make peace with it, the more sense Ruby begins to make.

I also think the post is a little disengenuine: it's assumed that when Pythonists monkey patch, they do so with solemn care, but when Rubyists do, it's all whimsy and folly. Any Ruby hacker worth his keyboard knows to take care when re-defining existing behavior.

Sitting here, I tried to think of an instance where open classes have caused me a problem.

On the other hand, I immediately thought of 3 places in my current project where they saved me considerable work.

Like most things, I believe this issue comes down to developer quality: prohibiting open classes or monkey patching isn't going to save you from the developer who would carelessly abuse these features.


From a theory perspective, prototypes with method update actually form a very complete formal calculus. Don't be so quick to reject method update as a hack-ish convenience. They're capable of encoding everything classes do from a 'traditional' OO perspective, and with some very nice properties. They are the lambda calculus of objects so to speak. Read Cardelli and Abadi's books and papers for a detailed examination of these ideas.

# Jason Watkins