Jay Fields' Thoughts: Ruby: Dynamically Define Method:
ezmobius, deciding not to use define_method because it is 3 times slower than def seems like premature optimisation to me. I can't help but feel that in (say) a web application, the effect that define_method will have on performance will be negligible, and that areas to focus on with respect to performance will probably be the interaction with the database, and caching of commonly used content. I think it's important to operate in two modes when programming - one where you focus on readability (and ignore performance) and another where you focus solely on performance increases. That way, you can fix those areas of the code that have a large detrimental effect on performance, and don't unnecessarily sacrifice readability in other areas.