CFSCRIPT gains about a 10% performance advantage (I wish I still had the
source for this number, but I can't seem to find it anymore... it was a good
article) and generally cleaner code if you're doing a lot of page logic;
obviously it loses out on the ease of screen display to tag based though.

   "The problem I have with CFSCRIPT and if() is that there is no
elseif()..." Actually there is, just use 'else if (expr)' with a space.

   The above comment is in the right vein though, CFSCRIPT just isn't very
powerful. In going w/ the tag based for display they seem to have left out
anything more than a meek gesture towards scripting. It's missing many tags
that would be beneficial, such as; cflock, cfthrow, etc. As well, common
short form syntax like 'var = (expr) ? true : false ;' or simple operators
like ++, --, +=, etc. (x=x+1 gets rather annoying :) are missing.

   Overall though, if you're doing more than three or four lines of
non-display coding, you might want to switch over to cfscript for speed and
easier reading. And if you plan to work w/ objects or complex structures
staying tag based is for the masochists. ;P


-----Original Message-----
From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]]
Sent: January 27, 2001 11:07
To: CF-Talk
Subject: RE: CFSCRIPT performance


> I have a question on CFSCRIPT performance.  I know that it is
> quicker to use
> CFSCRIPT than to use CFSET.  Is it likewise quicker to use the
> CFSCRIPT if()
> over CFIF?  I have a CFIF checking that one of 14 empressions are met (13
> ORs).  Would it be better to use CFSCRIPT for this?
>
> This is for the security on a web site, so it needs to be efficient.

CFScript is more efficient as long as you aren't just doing just a couple
<CFSET> or <CFIF>

The problem I have with CFSCRIPT and if() is that there is no elseif(), you
have to embed things in the else part of the code, which gets very deep if
you want to check loads of variations (and can't use switch, such as ranges)

CF4.5.2 has faster looping in CFSCRIPT than in CFML, so that's an advantage

Also, as Robert pointed out, no white-space!

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to