473,425 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes and contribute your articles to a community of 473,425 developers and data experts.

Coldfusion Tips and Tricks

48
Careful use of # signs

The ## (pound) sign is very important in Coldfusion.

Expand|Select|Wrap|Line Numbers
  1. <cfoutput>#variablename#</cfoutput>
is OK.

However using ## inside cfset and cfif tags is not good coding.

The following would be considered bad coding:
Expand|Select|Wrap|Line Numbers
  1. <cfset var1=#variablename#>
  2. <cfif #variablename# eq "">
The ## sign are not necessary inside <cfif> and <cfset> tags because it takes more time to execute.

A good coding standard would be to avoid using pound signs around variables inside cfset and cfif tags:
Expand|Select|Wrap|Line Numbers
  1. <cfset var1=variablename>
  2. <cfif  variablename eq ""></cfif>
A tidbit of information but valuable nonetheless.


cfinclude and custom tags

All of us are familiar with cfinclude and custom tags, both tags are used to include a file. What is the difference between them?

The main difference between cfinclude and custom tag is that the include tag works in a copy-paste manner. The scope of variables used in the calling page is available in the included page. But custom tags are individual ColdFusion pages, variables and other data are not automatically shared between a custom tag and the calling page, so we have to pass it as arguments.
Mar 13 '08 #1
2 5448
acoder
16,027 Expert Mod 8TB
I've moved this to the Articles/howto section.

Thanks for posting this. The pound signs should only be used when necessary, so only surround the variables/functions that need them, not the whole text.
Mar 13 '08 #2
acoder
16,027 Expert Mod 8TB
Rather than having small bits of info, one article with a collection of tips is more useful.
Mar 31 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: John H | last post by:
Can anyone help with why our pages are slow to load during peak-use hours? We run a database site getting 4 million hits a month which becomes painfully slow during peak hours. The slowness is...
2
by: Howdy | last post by:
All: I have been confronted with a huge project of converting a major coldfusion website with a very large number of paid subscribers to a dotnet website. I'm looking for: A) advice on how...
7
acoder
by: acoder | last post by:
This page will link to a number of tutorials. Coldfusion Language Coldfusion Variables Using Coldfusion Variables Coldfusion Image Gallery How to upload a file in Coldfusion How to send...
0
by: travolta003 | last post by:
Windows XP tips and tricks. Learn how to bypass very common windows problems, speed up your system and make it more reliable with useful tips and tricks. http://windowsxpsp2pro.blogspot.com
0
by: travolta004 | last post by:
Windows XP tips and tricks. Learn how to bypass very common windows problems, speed up your system and make it more reliable with useful tips and tricks. http://windowsxpsp2pro.blogspot.com
68
bartonc
by: bartonc | last post by:
I've decide to compile a bunch of your favorite tips and tricks for the Articles section. I found a post yesterday by Chrisjc that is a perfect example. I copied his post over to create Dealing with...
2
bartonc
by: bartonc | last post by:
I've decide to compile a bunch of your favorite tips and tricks for the Articles section. Post your favorite tips and tricks here, in this thread, and I'll copy the best ones to a Tips and Tricks...
0
by: smartfix | last post by:
Windows XP tips and tricks. Learn how to bypass very common windows problems, to speed up your system and make it more reliable with useful tips and tricks. http://windowsxpsp2pro.blogspot.com
8
Frinavale
by: Frinavale | last post by:
Edit Many times we spend hours and hours trying to solve a problem. When we finally figure it out, we want to share it to keep others from suffering the same way! That's why we have this "Tips...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.