Category Archives: Cold Fusion

Most developers know that if you reference a variable without a scope prefix (such as variables, form, URL etc) ColdFusion will check each of the available scopes until it finds a variable of the name you are looking for.

The order in which ColdFusion checks is:

  1. Function local (UDFs and CFCs only)
  2. Thread local (inside threads only)
  3. Arguments
  4. Variables (local scope)
  5. Thread
  6. CGI
  7. Cffile
  8. URL
  9. Form
  10. Cookie
  11. Client

* Note: Although the order above came from the Adobe docs I’m not sure about “cffile”. It doesn’t seem like a scope, more like a return variable much like cfquery. But see below for that )

Of course this means if you are trying to output #myVar#, and that variable exists in the URL as well as the form scope then #URL.myVar# is what ColdFusion will evaluate. This might not be what you want however, leading to frustrating inconsistencies.

Another downside of not scoping your variables is performance, why make ColdFusion look behind each door (scope) for a variable? Most times you will know exactly where the variable is, so you can improve things by clearly specifying which scope you are using.

But what about query variables either in <cfoutput query=””> or <cfloop query=””>?

“Query” isn’t a scope as such but can still be effected by the order of evaluation if you have variable naming conflicts with columns from your query.

How often do you prefix your recordset variables with the query name? I bet most developers out there don’t prefix their query variables, instead take the easy way out with something like:

  1. <cfloop query=“myQuery”>
  2. #firstName#<br />
  3. #lastName#<br />
  4. #email#
  5. </cfloop>

Daemon is throwing it’s hat in the ring for this years, “Google Summer of Code“, in an attempt to get the FarCry code base onto the program. It would be a first for ColdFusion, and with any luck we might get some great projects off the ground. But we need help!It’s a three stage process:

  • Get accepted to the program by Google
  • Attract student applications
  • Help people build beautiful things

Getting on the program is up to Google. Our GSoC Application and growing Project Ideas List are available online — we can only hope the powers that be at Google find it appealing. We’ll be the first ColdFusion project sponsored if we’re successful.

Helping folks to build things I think will be the easy part — its in our control, its something we do daily, and it just means hard work. Never been afraid of that.

What we really need help with is spreading the word and making sure that, if we are successful, we attract enough students who are comfortable with ColdFusion — comfortable enough to make an effective contribution. So if you’re a student, or you know a student, or you are involved with an educational institution that might have the odd student, send them our way!

Successful student applicants are guaranteed sweet loving from the FarCry Community and upon completion a cheque for $4,500US from Google for their troubles. It’s quite a caper.

Attention Students:

What will you do to ensure that your accepted students stick with the project after GSoC concludes?

As developers, we like to build things that make a difference. It’s what motivates us. We hope it motivates our students too.

We’re going to ensure that:

  • all students get the attention from mentors they need, so that they are not hung-up by easily resolved issues
  • lead developers of core sub-systems are agile enough to provide advice, APIs and/or bug fixes, so that things outside their control don’t impact student efforts
  • good code makes its way into a production release as soon as possible
  • good students get the kudos they deserve in our community and beyond

And that’s the memo.

Here is a short tutorial to add a logo/title to your webpage that will view nicely with images/css switched off

This trick works really well. Basically, you set a style for h1 in your css that indents the h1 text by -900em (so it will display off the page, and thus not be visable when css is enabled) and it replaces it with an image (your logo)

So, with CSS on you will see a logo image, and when it’s not enabled (perhaps on your phone) the <h1> text will display.