From: Joost Diepenmaat Date: 2006-05-04T17:13:08+09:00 Subject: Re: Sharp knives and glue On Wed, May 03, 2006 at 12:33:24AM +0900, Leslie Viljoen wrote: > I have read some posts about Ruby being a sharp knife and shooting yourself > in the eye and > I must admit, I have been burned by these things. My Rails project worked > perfectly until > I uploaded it to Textdrive and since Glue had been installed, the basic > environment had been > altered. By chance, Glue had defined a class with the same name as one of my > Models and > somehow it overrode my class when the project ran. They removed Glue when I > asked and > everything worked again, but it took me two days to find the problem. I must say that this worries me too, sometimes, since I have been bitten by this problem a few times in Perl. Although it really isn't Ruby's fault, I see a lot of example code and "ways of working" that just assume people will create top-level classes with the logical name. Whenever I create programs with more than a few classes, I try to put all of them into one or a few "namespaces" to help prevent this. I believe you can also do this with Rails / active record, though I can't recall exactly how that workes. In any case, yes this is a potential pitfall, and one of the things that Java is supposed to prevent. In my opinion the tradeoffs java makes in the name of "code security" aren't worth it unless you're working on really huge projects, with many programmers simultaneously, but YMMV. On the other hand: from what I can see, some Ruby programmers and book writers could be a bit more careful and explicit about choosing class names and polluting namespaces. Joost.