Ben Forta

Blog

October 3, 2000

Forcing A Settings Refresh

As of ColdFusion 4.5, ColdFusion Administrator settings are cached to improve performance. This is a good thing, unless you ever manipulated the Administrator settings directly (as my tag does). If you do manipulate these settings you'll need to force ColdFusion to reread the settings using the...

October 2, 2000

Use CLIENT Variables Like SESSION Variables

CLIENT and SESSION variables are different. SESSION variables supports complex data types (like arrays and structures), but they are limited to a single machine. CLIENT variables can be shared in a clustered environment, but they do not support complex data types. So how do you get the best of both...

October 1, 2000

No Spaces Around Equals Signs

Any time you perform an assignment or pass an attribute in ColdFusion you use NAME=VALUE pairs. ColdFusion allows spaces before or after the = sign, but other languages (most notably XML) do not. While there is nothing wrong with having spaces before or after the equals sign, it's best to get used...

September 30, 2000

Don't Overuse Lists

ColdFusion lists are simple to use, but they are not as fast as arrays. In fact, array access is as much as three times faster than list access. So, while lists are simple to use, don't overuse them. (Applies to: ColdFusion 2 (or later))

September 29, 2000

Never Use DB Admin Login

When you define your data sources for use with ColdFusion, don't ever use the database administrator's login ("sa" on SQL Server for example). With administrative access you greatly increase the chance of someone executing rogue SQL statements (like DROP table). Give the data source just the access...

September 28, 2000

Never Assume a Variable Exists

Never ever assume that a variable exists, even if you wrote the code that passes that variable (perhaps as a URL parameter or a FORM field). To be safe, use a list of tags to initialize all variables. If they do indeed exist the tag will be ignored, so no downside, and lots of upside. (Applies to:...

September 27, 2000

Respect SQL Reserved Words

All SQL implementations have reserved words, words that have special meaning to the database engine. Be very careful to respect these reserved words or your app will start doing funny things when you least expect it. This includes the word "date" which must never ever be used as a column name....

September 26, 2000

Get a List of Retrieved Columns

Need to know the names of the columns retrieved in a database query? Simply refer to #QUERY.ColumnList# (replacing QUERY with your own query name). (Applies to: ColdFusion 3 (or later))

September 25, 2000

Use CFQUERYPARAM

Any time you use a ColdFusion variable within a SQL statement, pass it with . This tag improves performance and also helps secure your SQL from potential URL tampering. (Applies to: ColdFusion 4.5 (or later))

September 24, 2000

Never Hard Code Custom Tag Return Variables

ColdFusion Custom Tags often have to return results back to the calling code. Resist the temptation to hardcode the names of the variables that will contain these results. Instead, let the caller specify the desired variable name as a tag attribute. (Applies to: ColdFusion 3 (or later))

Page 488 of 489 (4890 posts)