Path: news.mathworks.com!not-for-mail
From: "Steve Amphlett" <Firstname.Lastname@Where-I-Work.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Why does everyone hate 'eval'?
Date: Thu, 11 Dec 2008 21:03:03 +0000 (UTC)
Organization: Ricardo UK Ltd
Lines: 20
Message-ID: <ghrv67$ml3$1@fred.mathworks.com>
References: <ghrlim$oqo$1@fred.mathworks.com>
Reply-To: "Steve Amphlett" <Firstname.Lastname@Where-I-Work.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1229029383 23203 172.30.248.37 (11 Dec 2008 21:03:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 11 Dec 2008 21:03:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 43398
Xref: news.mathworks.com comp.soft-sys.matlab:506430


"Johan Carlson" <Johan.E.Carlson@gmail.com> wrote in message <ghrlim$oqo$1@fred.mathworks.com>...
> Hey guys!
> 
> I've been running into comments like "NO, NO, NO, WHATEVER YOU DO,  DO NOT USE EVAL!!!!' in various posts during the past few weeks.
> 
> OK, I can see that over-use of eval would create, cool-looking, but totally unreadable and inefficient code.
> 
> But, are there any other reasons to hate eval this much? 
> 
> Good coding style on the one hand, I still see the occasional use of eval as highly motivated.
> 
> Comments?
> 
> /JC


I still use eval when building commands to pass to system.  Once I'm happy that the command string (echoed sans semicolon) isn't going to cause damage (nasal demons, etc), I'll then uncomment the following system(command) function.