[thelist] Coldfusion: getting javascript variables

.jeff jeff at members.evolt.org
Wed Jan 9 00:54:25 CST 2002


erik,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Erik Mattheis
>
> I never use unnecessary hashes - but the books and
> resources I learned from always used them and I was
> shocked when I found out you hardly ever need to ...
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

even the allaire documentation gets it wrong in spots.  go figure.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> I maybe wrongly assumed it would be more understandable
> to someone just learning CF to have them in there ...
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

more understandable or not, as a mentor, we should be trying to show the
proper way of doing things at all times.  no sense helping make the improper
way seem more understandable.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > #Evaluate("#form.item" & #this_item# & "Name")#
> >
> > could be rewritten to simply be:
> >
> > #form["item" & this_item & "name"]#
>
> Yeah, I suppose it could, couldn't it! Didn't catch
> my wrongly placed hash though!
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

yeah i did, i just chose to ignore it.  however, the wrongly placed hash
kind of strengthens my point about keeping the hashes and extraneous
function calls (Evaluate()) to a minimum.  it makes for less mess which
makes for less chance to screw up.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> I do perhaps overuse evaluate and eval one could say if
> one wanted to ... but I still get a whisp of that warm
> fuzzy feeling I got when I first understood what it did
> ... I was ONE with the MACHINE!
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

Evaluate() and eval() are hacks for lazy programmers.  it might be a warm
fuzzy feeling you're getting, but you're not truly one with the machine
until you learn how to *not* use Evaluate() and eval().  save those cpu
cycles (server and client) for more important things.  ;p

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list