Why exactly is eval evil?
Posted
by Jay
on Stack Overflow
See other posts from Stack Overflow
or by Jay
Published on 2010-04-03T13:50:56Z
Indexed on
2010/04/03
13:53 UTC
Read the original article
Hit count: 347
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 programming languages, but I´ve not yet seen a list of clear arguments against the use of eval. Where can I find an account of the potential problems of using eval?
For example, I know the problems of GOTO in procedural programming (makes programs unreadable and hard to maintain, makes security problems hard to find, etc), but I´ve never seen the arguments against eval.
Interestingly, the same arguments against GOTO should be valid against continuations, but I see that Shemers, for example, won´t say that continuations are "evil" -- you should just be careful when using them. They´re much more likely to frown upon code using eval than upon code using continuations (as far as I can see -- I could be wrong).
© Stack Overflow or respective owner