On Sun, 3 Oct 2004 10:47:16 -0700, Barney Boisvert <[EMAIL PROTECTED]> wrote:
> In general, CFML and CFSCRIPT should be fairly similar in their
> execution profiles.  However, there are some fundemental differences
> in the way they work, so some things will be faster with CFSCRIPT.
> For example, CF needn't do any type of output trickery, because
> CFSCRIPT never outputs anything.  With CFML, between every tag there
> is an opportunity to have content, so CFMX has to compile the code
> with lots of output blocks, most of which are likely unused.  That
> should make CFSCRIPT slightly faster, though the difference will be
> miniscule.
> 
> Another difference is looping:
> 
> <cfloop from="1" to="#arrayLen(a)#" index="i">
> </cfloop>
> 
> <cfscript>
> for (i = 0; i LTE arrayLen(a); i = i + 1) {
> }
> </cfscript>
> 
> In the former, the "to" value is computed once, before the tag starts
> executing.  In the latter, it is computed each loop iteration.
> 
> I guess my point is that there are subtle difference between CFML and
> CFSCRIPT.  They aren't necessarily 100% equivalent.
> 

While I personally feel that the cfscript vs. cfml argument is purely
academic in MX (obviously when talking about constructs that are
comparable, not stuff like queries, which you can't do in cfscript
natively), Barney I have a question. In your reply, you note:

"For example, CF needn't do any type of output trickery, because
CFSCRIPT never outputs anything. With CFML, between every tag there is
an opportunity to have content, so CFMX has to compile the code with
lots of output blocks, most of which are likely unused."

What do you mean by that? With cfscript, you can use the writeOutput()
function to output content within cfscript, so I'm not really sure
what you mean. Further, I have written a CFC of methods containing the
tag-based functionality not available in cfscript (i.e, cfquery,
cfdump, etc.), and the ones that do output content work just fine.

So while I see what you're saying with the arrayLen() example in
cfscript, I'm not sure I agree with your cfoutput argument.

Regards,
Dave.
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to