This is my take

<cfset var1 = "bla">
<cfset var2 = "bla">
<cfset var3 = "bla">
<cfset var4 = "bla">
<cfset var5 = "bla">
<cfset var6 = "bla">
<cfset var7 = "bla">

Using CFSET like this, the CF server needs to process every tag individually
creating overhead.  Now its not so bad if you have just one or 2, but it can
become more so when you have alot of processing.

If you had

<cfscript>
        var1 = "bla";
        var2 = "bla";
        var3 = "bla";
        var4 = "bla";
        var5 = "bla";
        var6 = "bla";
        var7 = "bla";
</cfscipt>

the CF server sees the CFSCRIPT block as a single tag and processing it
justly, as one tag.

Now, its true you can not use CF tags within the CFSCRIPT block, but now
with CFMX, you can use CFFUNCTION to create function blocks that you can do
processing with tags, but call them from within your CFSCRIPT block.

Easy example

<cffunction name="dump">
        <cfdump var="#Arguments.Struct#">
</cffunction>

<cfscript>
        dump(struct=cgi);
</cfscript>

By doing this, you can call a dump from within your cfscript block.

Steve

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Knott,
Brian
Sent: Wednesday, 2 July 2003 9:50 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: Cf Programming Style


Nick,
        My understanding is that <cfscript> was introduced to assist
developers who where familiar with languages like Javascript.  As far as I
know there is not performance difference between using <cfscript> or <cfset>
to define variables.

One thing to note is that <cfscript> done not have access to any <cf> tags,
ie you can not use any cold fusion tags inside a <cfscript> block.

Brian knott

-----Original Message-----
From: Nick Gorst [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 2 July 2003 9:36 AM
To: CFAussie Mailing List
Subject: [cfaussie] Cf Programming Style


Hi.

I've been wonderting for some time whether there is any benefit to using
<cfscript>
to embed code within a file over using cold fusion tags to perform the
same functionality? An example I have recently come across used cfscript
blocks to assign variables, a function that could have been implemented in
<cfset> statements i.e.

<cfscript>
//DATABASE DETAILS
        datasource = "dsn";
        username = "username";
        password = "password"
</cfscript>

As opposed to

<cfset datasource = "dsn">
<cfset username = "username">
<cfset Password = "Password">

Is there a reason to prefer one method over the other?

I'd appreciate your thoughts.

Nick Gorst
Web Developer

BLA Pty Ltd
45 Aquarium Avenue
Hemmant, Queensland 4174
Australia.
Phone: (07)3890 1115
Fax:   (07)3890 5388
Mob:    0419 901 115
www.bla.com.au

****************************************************************
This e-mail, together with any attachments, is intended for the named
recipient(s) only. If you have received this message in error, you are
asked to inform the sender, mailto:[EMAIL PROTECTED] , as quickly as
possible and delete this message and any copies of this message from your
computer system network.

Any form of disclosure, modification, distribution and/or publication of
this e-mail message is prohibited.  Unless otherwise stated, this e-mail
represents only the views of the sender and not the views of the Bob
Littler Agencies Pty Ltd
****************************************************************


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]

MX Downunder AsiaPac DevCon - http://mxdu.com/

Reply via email to