Most ColdFusion developers consider it "Best Practice" to always lock the application scope every time you use it in your code. A lot of this really stems from the early versions of ColdFusion, when not locking your application scope could cause memory corruption. As of CF MX memory corruption is no longer an issue but race conditions are still possible, so Adobe still recommends that you lock your application variables as a "Best Practice" to be on the safe side.
Unfortunately, many developers really don't understand CFLock, and many developers don't understand that "Best Practices" are not always black and white.
We have an opening available for a Senior ColdFusion Developer at See's Candies (www.sees.com). If you are interested check out the job description and apply online at Monster or Dice. I'll be coming to the Orange County ColdFusion Users Group on Thursday, January 17th. As the Web Development Manager for See's, I will be the direct supervisor of the successful candidate. So if you live in the Los Angeles/Orange County area, come to the meeting and let me know you are applying.
In my first year or so of developing ColdFusion applications, I didn't really understand how to use CFLock. That caused me a lot of headaches, and I have learned to use it properly since then. In the last year or so I have had several calls and emails from people who's sites aren't performing well under load where I was able to identify their problems were due to improper use of CFLock. It is important to use CFLock to protect the integrity of data that is shared across requests in your application. However, you need to make sure you do it right. Improper use of CFLock may not cause any noticeable problem in your development environment, but once your application starts to experience a significant amount of load, poor locking implementations can cause your application to grind to a halt.
I was just reading a post on ColdFusion Muse on what Mark Kruger's motivations for blogging are, and it got me thinking. Why did I really start blogging? Sure I have noble intentions of sharing the knowledge and experience I have accumulated over the many years I have been developing with other ColdFusion developers. Sure I may find myself referring back to my blog entries to remember how I did something from time to time. And it may even bring me a little bit of business once people start to recognize who I am. All those things are reasons why I wanted to start blogging years ago, but they never really pushed me over the edge and motivated me to write my first blog entry.
I just went on to cast my CFEmmy votes and was a bit suprised to see my blog listed under the best newcomer! Thank you for the nomination, it gives a little validation to know that I'm not just talking to myself and other people are finding what I am writing useful.
CodFusion 8 adds three new attributes (characters, file, and array) to the CFloop tag that make it a little easier to loop through the contents of files and arrays. The array attribute is pretty cool, but the file/characters attributes are really exciting for me. In previous versions of ColdFusion, to loop through an array you would create the loop to basically count from 1 to the length of the array, then access each item in the array within the loop like:
ColdFusion 8 has a new attribute in the CFLocation tag called StatusCode. In previous versions, if you wanted to do a 301 redirect, you had to use a combination of two CFHeader tags to accomplish it. As you can see by comparing the old method to the new method below, the good folks at Adobe have saved us 57 keystrokes per redirect by adding this new attribute. As a typical lazy programmer, I sincerely appreciate their efforts.