Why should exec() and eval() be avoided?
There are often clearer, more direct ways to get the same effect. If you build a complex string and pass it to exec, the code is difficult to follow, and difficult to test. Example: I wrote code that read in string keys and values and set corresponding fields in an object. It looked like this: … Read more