From: Patrick Hurley Date: 2005-12-23T23:32:42+09:00 Subject: Re: Diff of opinion on dynamic stuff On 12/23/05, Bob Hutchison wrote: > I agree. But these issues and a few others (e.g. types, inheritance, > encapsulation, modules, namespaces) are often combined, or conflated, > deliberately, into a single solution These are powerful tools and their power increases by using them together, I suppose that the danger (the point of the article) may as well, but you would have to show me a case. The "danger" issues appear to be specific case issues and not with their combined use. > ...in Ruby, what if some clever 'programmer' > decides to fix a problem by replacing a method without removing the > original from the source? Trust :-) It is possible to intentionally write code to pass a unit test and later fail. Of course you could argue that some higher level set of tests should fail and start a "arms race" with your devious programming the and rest of the responsible coders writing unit tests. Of course you could just take the poor misguided soul aside and explain the error of their ways -- show them how to write a proper unit test for the original method that was in error and then correct it. Of course if you could just fire the numbnut too :-) If you work in an environment where you cannot trust the developers powerful tool may be better replaced with straight jackets -- as always select the best tool for your environment and task. > A little more than just a documentation issue I think, but certainly > related. What if a soon-to-be-unemployed 'programmer' built up a > string in memory, maybe computing the name somehow, then evaled it? Trust... > I'd be more concerned with having to re-factor a controller and > breaking a bunch of URLs (but I don't know Rails well enough to know > if this is actually a possible issue). Internal to the application good coding in Rails uses url_for type helpers that will generally deal with all of this correctly. External to the app, if it is a concern routes can be pretty easily manipulated -- but this is a good point for externally linked sites, action names are "pushed" into your URL interface by default and they should be carefully considered. > Cheers, > Bob Happy Holidays and thank you for taking the time to respond pth