[thelist] output value

Morgan Kelsey morgan at morgankelsey.com
Thu Jan 23 13:20:00 CST 2003


scott,

----- Original Message -----
From: "Scott Brady" <evolt at scottbrady.net>
>
> >er, no, that's wrong.
> >you should hardly ever need to use Evaluate. its a performance dog, makes your
> >code unreadable, and is usually uneccessary.
>
> It's not "wrong".  If it works, that means it's probably not wrong.  There might
be a better way, which is different.
>

sorry if that was too black and white for you there. you are correct or course,
but that argument quickly turns into "nothing is wrong". and anyway, the better
way is not to use evaluate, but to use structure notation. if you want to look at
in grays, with black being "right" and white being "wrong" (i'm trying to avoid
arguments here), i'd call using evaluate over structure notation a #CCCCCC.


> For what it's worth, I just ran some tests with the only difference being using
Evaluate versus your method with 200 form fields.  The performance hit difference
was nonexistent on the first time running it and nonexistent thereafter (in fact,
some times the Evaluate method ran faster). That was in CF5. In MX the results
were even faster for both of them.
>
> If you're using "Evaluate" 1000 times in a page, there might be a bigger hit,
but I can't even fathom that occurring.
>

for what it's worth, the test isn't worth much unless it's done under load.
regardless, evaluate doesn't really "say" to me what this code is doing. however,
when i see
struct['text' & var] i know exactly what is going on.

> As far as it being more "readable" that's subjective. I find Evaluate to be more
readable than that method, of course that's probably because I'm used to using
Evaluate for this case.
>

maybe that's because you don't use structure notation enough?

really though, before we have a war here,  you'll be really hard pressed to find
*anyone* that recommends using the evaluate method over structure notation. i
would even return work containing evaluate() to someone as erroneous, but maybe
that's just me.


nagrom
http://morgankelsey.com





More information about the thelist mailing list