Top 10 Underrated Functions in ColdFusion

Updated , First Published by Pete Freitag

I gave a presentation at my local CFUG yesterday called 10 Underrated Functions in ColdFusion, I plan on doing one for tags as well at some point. Here was my list of functions, in no particular order:

Did I have any obvious omissions? What would be on your list?

The Fixinator Code Security Scanner for ColdFusion & CFML is an easy to use security tool that every CF developer can use. It can also easily integrate into CI for automatic scanning on every commit.

Comments

todd sharp

There are a LOT of functions that I think are underrated - in fact, I think all built-in functions are overlooked at one point or another. I honestly have been meaning to re-read the function reference to remind myself of some of the gems out there.

Brian Kotek

I'm always amazed whenever I see someone manually implement code to do what listQulify() or listChangeDelims() does.

TJ Downes

IsValid() is one of the best functions ever

Raymond Camden

A few: incrementValue/decrementValue: If you don't need to keep the result, this is handy in urls, for example, linking ot the next page. isDebugMode - add your own debug stuff (I need to blog this) A big amen on isValid. I think it is probably the least known cool feature of CF7.

Ryan Guill

ArrayToList() and ListToArray() would have to be one that I see implemented in other ways frequently.

todd sharp

Brian - what about manual implementations of fileExists() or directoryExists()? I'm guilty of those (a long time ago ;)

Sam

"I'm always amazed whenever I see someone manually implement code to do what listQulify() or listChangeDelims() does." I'm even more amazed that I still do it from time to time =)

todd sharp

Forgot to subscribe.

JAlpino

They may not be under-rated but I find that val() and htmleditformat() are often overlooked in securing templates from incoming POST/GET data.

Charlie Arehart

I'm with Brian on ListQualify. That's a hidden gem from 4.01 that it seems many missed (and continue to do). Great list, Pete. Thanks for sharing.

todd sharp

What about urlEncodedFormat() and urlDecode() - I've seen manual workarounds to these before.

Tjarko Rikkerink

Mine would probably be monthAsString in combination with setLocale(), coming from the Netherlands (in other words a non-english speaking/reading country) i still see a lot of developers making a list with the locale names of the months and then a loop with 1 to 12 and getting the correct name :-) monthAsString(month(now())) would do the trick.. also for days. Much overlooked function. LSDateFormat(now(),'mmmm') would also do it.

Oliver

XmlFormat() is kinda the suck, it does not parse xml all the time correct. I know its sloppy but I have been to busy to combine the 2 udf's but these in tandem will format anything in xml http://www.cflib.org/udf.cfm?ID=999 and http://www.cflib.org/udf.cfm?ID=572

Pete Freitag

Oliver, I'd love to see an example of where XmlFormat doesn't work. I haven't had any problems with it, not to say there aren't - I'd just like to see first hand.

Ben Nadel

Just to go along with value list, there's the little used QuotedValueList() which does the same thing as ValueList() but puts quotes around each list item (like ListQualify() with quotes).

Raymond Camden

xmlFormat is VERY broken. I've had numerous issues with it on BlogCFC where xmlFormat would let characters by (like MS Extended chars) that mess up valid XML.