4 ms·
This is the whole issue with open classes and many libraries (transitive dependencies make this issue exponentially more likely, on the number of libraries). I
by DanielRibeiro 16y ago
This is the whole issue with open classes and many libraries (transitive dependencies make this issue exponentially more likely, on the number of libraries).
I have commented on this issue a while back (http://bit.ly/cNez8i http://bit.ly/cNez8i), and some people were kind enough to fork ruby (http://gist.github.com/358467 http://gist.github.com/358467) and enable scoped Open Classes, like Scala, Groovy and C# have. This is great for dsls (many dsls that change base classes can happily live in the same project without conflicting with each other) and libraries (I can do whatever I want in my library, extending Object, Enumerable and Kernel, left and right, and the users will not be affected).
However, this very openness made the "moving to a newer and better version of ruby" movement harder. Just hope 2.0 will set things right.
Disclaimer: open classes are great. I think they should be allowed, only highly discouraged for libraries and frameworks, who should stick with scoped open classes for most of the time.