From: Marc Heiler Date: 2008-03-01T11:51:59+09:00 Subject: Re: Monkeypatching is Destroying Ruby I actually think we should avoid the term "monkey-patching" at all. It seems to imply a somewhat negative, and what is even more important, inaccurate term. The first thought one gets at reading "monkey-patch" will be that it is associated with something inherently bad/negative. Look at the term "global variable" instead. It does not imply that using it is bad instantly (which in fact it is not, it is just that there are many better ways than global variables in most cases. Same with class vars.) and it even gives a tiny little help, by stating that its scope is "global". > I enjoy using Facets, but it does cause problems in combination > with other common frameworks, particularly Rails. I guess that would not be totally unexpected, rails seems to be non regular in many situations, for the better or worse. Rails, for one example, even insists(ed?) on evaling my .irbrc and in my humble opinion, Rails has exactly 0 valid reasons to look there - even moreso as Rails choked on some stuff inside it, whereas the normal irb has had exactly 0 problems with it. Huh ... ? ;) By the way, about .freeze - I think .freeze is a little bit... I mean, it does not have many valid use cases? Once the object is frozen, it is kinda useless from that point on since it will no longer change, thus losing advantages of code and starting to behave more like a static configuration/Marshalled code. I cant really recall having used .freeze the last 3 years hmm > I think your library is providing things that YOU think should > be part of Ruby. Personally I also sometimes come to the point where I ask why a certain idiom or solution is not part of official ruby. And in a few situations I think the most popular idioms should be considered for conclusion, I think that happened in a few rails idioms which became part to ruby in 1.9.x But for me, this is happily no problem at all, since you can freely extend Ruby to your liking. (Though I am still often confused when to use alias, and when to use alias_method instead...) That is an advantage you get compared to i.e. python more quickly and readily in Ruby IMHO. Although I do not use facets (I don't really have a use case, for personal stuff i use my own files, and for distributing stuff I try to avoid all my own modifications and more relying on "official" ruby code/way instead), I think there is in fact a use case for something like facets. And I am quite confident that the situation would change if something like that would be included in default ruby too. At least it would be a more standardized solution :) But that is just my personal opinion, let's see what can or will happen all the way up to 2.0 Regards. -- Posted via http://www.ruby-forum.com/.