[thelist] <cfset> vs <cfscript> for a simple function call

Sarah poohbear at designshift.com
Wed Jul 16 13:05:10 CDT 2003

> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > From: Sarah
> >
> > I actually agree with both of you, but I have always
> > felt that the most annoying part of ColdFusion was not
> > being able to just call a function without having to use
> > a <cfscript> block or something silly like
> > <cfset temp = SomeFunction()>.
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>why the resistance to <cfscript> blocks?  i actually find myself using them
>wherever possible in my coding.
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> > So, in rebellion, I lean towards using <cfset> in the
> > "improper" way.
> ><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
>... and thereby hurting the readability of your code which will come back to
>haunt you when you need to maintain it again at a later date.

I guess I just find <cfscript> "uglier". And (although this is not an issue 
in this particular case), there are problems with debugging in a <cfscript> 
block, because the line number reported is always the first line of the block.

<tangent>OTOH, CFMX's error reporting seems pretty iffy, with the line 
number often not reflecting the actual line, and sometimes the line number 
is reported as -1. Also, the template cited is often wrong, in that it 
actually just includes the offending template.</tangent>

But now that I've thought about it some more, and also after reading 
Michael's last message re: MM may not support this in future releases, 
since it is not documented, I think I have been turned from the dark side :)


More information about the thelist mailing list