[thelist] RE: What is the ColdFusion equivalent to eval()?

jeff jeff at members.evolt.org
Tue Apr 24 22:19:46 CDT 2001


jon,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: jon steele
:
: I used quotes on the left hand side with
: my vars inside the quotes, and it worked
: (Raymond's idea),
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i would caution against "dirty" solutions such as the quotes around the
variable name combined with another variable on the left side of the
assignment operator (=).  this is sloppy programming that will lead to lost
time when maintaining this app down the road.

one thing to keep in mind is that each successive version of coldfusion
server has been more strict than the previous in its tag/code parsing.
what's to say that these sorts of non-standard methods will be allowed in
future versions?  best practice dictates avoiding these sorts of things
entirely.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: The whole thing is one messy script, with
: forms sending lists within lists and a
: couple of listtoarrays to split it in
: arrays and... anyway, it works now.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

"one messy script" is a scary thing to say about a block of code.  whenever
possible, it's better to spend alittle extra time to think out as simple of
an approach as possible to a problem.  the time you'll save yourself or
someone else later will be almost always be greater than the initial extra
you lost in getting it right.

that being said, i think if you describe the problem you're encountering
there may be an easy way to accomplish what you're trying to do, but in a
straightforward, less error-prone fashion.

just for the sake of potentially saving myself the grief of having to work
with this "messy script" (*grin*), i'd even be willing to analyze the
problem and come up with a more manageable method of solving it.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: But at the end of all this (when comparing to
: php), I've come tot he conclusion that CF really
: does suck in string handling :-).
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i would argue against that statement all day.  cf is chock full of intensely
useful string functions -- specifically those related to lists.  however,
unless you're used to thinking of strings as lists, it can be difficult to
come up with an elegant solution.  once you "get it" though, you'll find
yourself using the various list functions to manipulate your strings in ways
you never imagined.  you may find that php has more obvious (to you) string
functions than cf.  my guess is your conclusion is based more on perception
than actual fact.

on the flip-side, i will say that coldfusion isn't terribly efficient at
doing lots of string manipulations.  if you've got alot of that to do and
it's gotta be really fast, then maybe perl or php (not familiar with it's
string manipulation performance) would be a better choice.  if you've got
something you've gotta do that's short and it's gotta be programmed quickly,
then coldfusion can't be beat.

still curious about the problem you're trying to solve though.

thanks,

.jeff

name://jeff.howden
game://web.development
http://www.evolt.org/
mailto:jeff at members.evolt.org





More information about the thelist mailing list