Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7645789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T10:02:03+00:00 2026-05-31T10:02:03+00:00

I am using ColdFusion 8 and 9. I was reading some ColdFusion best practices

  • 0

I am using ColdFusion 8 and 9.

I was reading some ColdFusion best practices yesterday. I came across a section that advised to always use CFSCRIPT whenever possible. The reasoning was that each CFSET is a separate request and needs to be opened and closed by the server (or something to that effect). Since CFSCRIPT is handled as a single block of code, only one open and close is necessary, thereby taking less time for the server process. This advice was given explicitly for ColdFusion 5.

I am wondering if this advice holds true today, almost a decade later. Personally, I use CFSCRIPT 99% of the time. I do, however, work with people who use only tags. In a project that I am working on, I encountered this code within a function:

<cfset LOCAL.TrackingInfo = structnew()>
<cfset LOCAL.TrackingInfo.referral = CGI.HTTP_REFERER>
<cfset LOCAL.TrackingInfo.ipaddress = CGI.REMOTE_ADDR>
<cfset LOCAL.TrackingInfo.useragent = CGI.HTTP_USER_AGENT>
<cfset LOCAL.TrackingInfo.querystring = CGI.QUERY_STRING>

I would modify it to look like this:

<cfscript>
    LOCAL.TrackingInfo = structNew();
    LOCAL.TrackingInfo.referral = CGI.HTTP_REFERER;
    LOCAL.TrackingInfo.ipaddress = CGI.REMOTE_ADDR;
    LOCAL.TrackingInfo.useragent = CGI.HTTP_USER_AGENT;
    LOCAL.TrackingInfo.querystring = CGI.QUERY_STRING;
</cfscript>

For me, the benefit is readability. And, it’s really easy to go back and forth between CFSCRIPT and JavaScript and Java (the little Java that I have done).

Is there a tangible readability or performance benefit to using CFSCRIPT? Is there any reason for a non-beginner to continue using CF tags?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T10:02:04+00:00Added an answer on May 31, 2026 at 10:02 am

    No real speed difference to speak of in modern versions of the language. As far as readability that is completely subjective to who is doing the reading. I work with a wide array of CF people. Some of those people have a really hard time following CFSCRIPT and others that is all they ever try to use(almost to the point of overkill). Personally I say go with what ever approach you are most comfortable with and is also an approach whatever team of people you are working with is acceptable. I think the ultimate goal here is to produce code that everyone in the team can easily understand and support if ever needed. An example of readability arguments could be that I know someone here that would say your CFSCRIPT block is not as readable as this:

    <cfscript>
        LOCAL.TrackingInfo  = { referral = CGI.HTTP_REFERER, 
                                ipaddress = CGI.REMOTE_ADDR, 
                                useragent = CGI.HTTP_USER_AGENT, 
                                querystring = CGI.QUERY_STRING };
    </cfscript>
    

    I do not think though either one of you is “more right” than the other. Just differences in personal coding styles.

    Or another example I work with one person who insists that all CF tags be in capital letters along with attributes. Their stated reason is it helps in readability. I do not find it any easier or harder to read when it is in all caps. If anything I find it just a hassle to always hold down the shift kit or hit the caps lock when messing with code on those specific projects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I've been reading up on coding best practices, and the importance of using
So I was reading through some ColdFusion code and I ran across a function
I am using ColdFusion 9.0.1 and some database that I cannot change. I am
I'm using ColdFusion to populate a template that includes HTML unordered lists ( <ul>
I am reading through a book for homework, and I understand that using #'
I was just reading through Learning Python by Mark Lutz and came across this
DATEFORMAT(Now(),yyyy-mm-dd HH:mm:ss.SSS) When using the code above, ColdFusion always returns the time as 12
We have a ColdFusion 9 script that runs regularly reading a CSV file and
I am using ColdFusion 9. I am not interested in non-CFSCRIPT answers. I am
I am using ColdFusion 8.0.1 I am working on an existing application that has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.