On Thursday 08 October 2009 08:15:06 am Kazimir Majorinc wrote:
I want to
compare opinion of Ruby and Lisp programmers on eval.
If you want to contribute few seconds, the poll is
on my blog, on the top of the right column.
There wasn’t an option for “Absolutely essential for the one time out of
billion you actually need it. Otherwise, avoid it entirely.”
I can’t remember the last time I used eval directly in Ruby, and I’ve
maybe once or twice in library code. I’ve also seen it abused by people
really should know better. 90% of the time you find yourself reaching
you’re Doing It Wrong. Another 9% of the time, you’re working around a
language feature, and it’d be better to fix that feature, or at least
use of eval deep in a library.
limitations, including not having eval. And many of its other
could’ve been worked around if there had been an eval. A simple example:
Downloading and executing code was complex and often disruptive – eval
would’ve made it trivial.
So… I avoid languages that don’t have eval. But I avoid using eval in
languages I use. Does that make sense?