Why exactly is eval evil?

前端 未结 12 1774
没有蜡笔的小新
没有蜡笔的小新 2020-11-22 09:51

I know that Lisp and Scheme programmers usually say that eval should be avoided unless strictly necessary. I’ve seen the same recommendation for several program

12条回答
  •  我在风中等你
    2020-11-22 10:30

    Like the GOTO "rule": If you don't know what you are doing, you can make a mess.

    Besides from only building something out of known and safe data, there's the problem that some languages/implementations can't optimize the code enough. You could end up with interpreted code inside eval.

提交回复
热议问题