Stuff about software development, agile and testing

Friday, July 20, 2007

eval vs define_method

There are many ways you could dynamically define methods and eval should be your last option. I really don't care how many variations of eval ruby provides but don't use it. Writing code inside string cannot help anyone not even you.
Please remember "with more power comes more responsibility".
define_method is much cleaner way of defining methods in meta world and gives much more readability.