BroadwayWorld.com - the Premiere Theater Site on the Net

Robert Diamond

Subscribe to Robert Diamond: eMailAlertsEmail Alerts
Get Robert Diamond via: homepageHomepage mobileMobile rssRSS facebookFacebook twitterTwitter linkedinLinkedIn

Related Topics: ColdFusion on Ulitzer

CFDJ: Article

Work Smarter...Not Harder

Work Smarter...Not Harder

In today's tough economic climate, the working world is becoming a more difficult place for everyone, including ColdFusion developers. Budgets are getting leaner, workers are being laid off, and work pressures are increasing as well. A recent discussion with fellow developers revealed that most of them were working longer hours than they used to - to deal with the decrease in staff. Several expressed the belief that they're now doing the jobs of several people, which is probably true, as the majority of companies are "tightening their belts" to ride through some rough economic waters. Piggybacked onto this news is an even worse bit of information - doing the jobs of several people probably won't earn you more money.

The articles in this month's issue might not earn you more money either, but they will help you work smarter and should earn you more time. As a ColdFusion developer you're already on the right track, as CFML has proven itself time and time again to be one of the best ways to hit the ground running on Web development. Now that you're developing in CF, the next step is to be a smarter CF developer. That's what this issue of CFDJ is about - working smarter to save time.

There are a few easy ways to do this. One way - custom tags - has been around for a while, and a new way - user-defined functions - was introduced in ColdFusion 5. UDFs, for those of you who haven't yet moved to CF 5.0, is best described as a relative of custom tags, not quite a brother or sister though, more like a second cousin. The most common way to save time as a developer is to reuse code. I do this all the time and I'm sure you do too. Parts of many of the projects I've worked on are similar to many others, and if anyone wanted to do a fascinating case study on the life of a developer, those digital footprints would certainly be the place to start.

An alternate way is to use other developers' code, which you can easily do through the many online directories and developer resources. Custom tags and user-defined functions are, quite conveniently for my ramblings, what this issue is about.

User-defined functions are defined within blocks of CFSCRIPT code. They're then referenced the same as all the other <cftags> we know and love. The code that makes UDFs do their thing is CFSCRIPT, which looks quite similar to JavaScript. Once you write a UDF you can then use the function anywhere you use a ColdFusion expression, such as in tag attri-butes and between the # signs in output.

How do UDFs differ from custom tags? For starters, they don't include access to any native CFML tag functionality. When writing a custom tag, you can use CFQUERY, CFHTTP, CFMAIL, and other CFML tags. On the flip side, user-defined functions provide the convenience of a simple scripting language and a simple return to send values back to the Web application. So, read on and decide for yourself.

Use them both and you'll be saving time, time you can spend enjoying life, or most likely, doing more work.

More Stories By Robert Diamond

Robert Diamond is the founder and editor-in-chief of BroadwayWorld.com, the premiere theater site on the net now receiving over 100,000 unique visitors a day. He is also the owner of Wisdom Digital Media - a leading designer of entertainment and technology web sites. He is also the lead producer on BroadwayWorld.com's consistently sold-out Joe's Pub concert series, and Standing Ovations benefit concerts. Diamond was also named one of the "Top thirty magazine industry executives under the age of 30" by Folio magazine. Robert holds a BS degree in information management and technology from the School of Information Studies at Syracuse University. Visit his blog at www.robertdiamond.com.

Comments (2) View Comments

Share your thoughts on this story.

Add your comment
You must be signed in to add a comment. Sign-in | Register

In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.

Most Recent Comments
Jerry Pirnie 02/14/02 01:43:00 PM EST

Actually, having looked at both the printer-friendly version of the article and the pdf version, I think that WAS the whole article, but the page numbering is screwed up (should have been 1 of 2, 2 of 2).

The reason it was so short was, it's the opening Letter from the Editor that you'll find in lots of magazines, with teasers about other articles in the issue. It looks like there's two detailed articles on UDFs in the same issue though:

"Making More of UDFs" is at http://www.sys-con.com/coldfusion/article.cfm?id=397.

"UDFs: Functional Literacy" doesn't appear to be in the online edition, but there's a pdf version of the entire issue at http://www.sys-con.com/coldfusion/pdf/udfs.pdf.

Blake Whitley 02/13/02 08:34:00 AM EST

This article was good except for the fact that I couldn't get to page 3 of 3. So I couldn't finish reading it.