By Peter Bell

ColdFusion - Why Bother?

If you're not using ColdFusion, why would you bother to start? It is a question Barry Beatie asked some time ago (scroll down to the bottom for the original post).

I see ColdFusion as "the 80% solution" - a great glue language that allows you to do lots of things pretty well and pretty quickly, and I think they have continued in that tradition with a lot of the functionality added in CF 8.

Traditionally, ColdFusion was *the* RAD scripting language on the JVM, but with Groovy, JRuby, Jython and the rest it now has to compete with a bunch of other languages. So, what is left? .NET integration, a kick ass templating language, and a very powerful set of tag libs that allow you to solve 80% of a lot of problems very quickly. It doesn't sound like that much when it is put that way, but for the right use cases it is still more than worth the licensing costs . . .

Would the Real ColdFusion Please Stand Up?
There are two ColdFusions. While there is a lot of chatter in the blogosphere about cfc's, design patterns and other OO goodness, I'd hazard a guess that a big chunk of CF development is still simple, procedural "getting things done" kind of coding. In that space it is really competing directly with PHP as a language to allow people fairly new to programming to bring databases and web pages together. In that space the real power of CF lies in how easy it is to do straightforward things. Tags like cfoutput, cffile and cfmail really shine as they allow anyone to write a functional website very quickly and easily without having to worry about what is going on under the hood. If your time has much value I'd argue that the cost of the CF license (especially if you only need to run standard or can even just use a shared CF hosting provider) is fairly trivial compared to the learning, typing and debugging time that CF's RAD tags will save.

In the other ColdFusion, things are a little more interesting. For experienced programmers, ColdFusion is probably not the first language that would come to mind, but it still has some pretty compelling use cases. It used to be that ColdFusion was *the* RAD dynamically typed scripting language running on the JVM (or the CLR if you used Blue Dragon). Now with JRuby, Jython, Groovy et al, just being a dynamically typed language on the JVM isn't a differentiator. So what does that leave us with for experience developers evaluating ColdFusion as a development environment?

I happen to quite like CFML as a templating language, but all of the scripting languages have templating solutions (most of them have multiple options), so I probably wouldn't pay for ColdFusion just because of the overall syntax. The .NET integration in CF8 is extremely cool. If you have a need for a single application to integrate natively with both Java and .NET code, that would be worth the price of admission compared to having to set up a SOAP or RESTful web service interface between the two parts of the app. I don't know how many people have that use case, but for those that do I think CF8 will be a godsend.

For the rest of us, it really all comes down to the tags. CFMail, cfoutput, cffile and the like are actually pretty irrelevant to an experienced developer working on a new non-trivial project. In practice you're gonna encapsulate those kinds of access into methods, so having to write another 10-15 lines of code for each once as part of your first Java or JRuby project just isn't that much of a pain point. The question then becomes why would you use CF and the answer depends almost entirely on your use case. ColdFusion 8 has a *lot* of tags. There are tags for implementing full text search via Verity, for manipulating images, for working with PDFs, for creating an AJAX front end, for integrating with Exchange, and for doing a bunch of other cool stuff. I would recommend that any experienced developer spend a morning, looking through all of that tags and figuring out which ones they would use on a given project. Then estimate how much longer it would take to integrate or write libraries to do what you need in your current development language (and then double it - come on - we *all* know that our estimates are always too optimistic!). Then look at whether you'll need standard or enterprise and how many servers and you should have a good sense of whether there is a ROI.

One important point. ColdFusion tags are also "80% solutions". If Verity works for you, cfsearch is a very easy way to implement full text search. If you need more, you may have to roll your own with Lucene. cfimage allows you to do a huge amount of things with images extremely easily, but if your whole business is based on manipulating images online, you may want to spend $15,000 on a best of breed image manipulation library. The cf AJAX tags are extremely cool, but if you want complete control you may want to just write your own proxy and write your own tag lib for generating hooks into your Javascript framework of choice. Don't expect the tags in ColdFusion to exceed best of breed in every space - that is not what they are for. For the vast majority of developers, any given tag will meet or exceed their requirements, but understand that you're buying a glue language, not the best image processor or full text search solution on the planet and set your expectations accordingly. With the exception of hassles with Verity, I've never run into any limitations with the power of any of the CF tags for any of the over 400 applications I've been involved with developing, but your milage may well vary.

I don't love ColdFusion. To me, it is like a slightly ugly friend who's always there for you. For my use case, "everything is an object" and in-language metaprogramming make me lust after Ruby. It's cool, it is fairly newly discovered (I know it has been around for more than a decade), and it has features that make it fun for a hacker to program again along with syntactic sugar galore. That said, when I did the math for my use case it made much more sense to continue to use ColdFusion and as I run my own business I chose the profitable over the cool.

Thoughts?

Oh, and if you like this, feel free to Digg it - I'd like to see this get outside of the usual CF suspects.

Comments
"80%" ... what an innovative way of looking at this!

can I give you a CF success story that may also fit this analysis?

One of the larger banking and investment (and soon insurance) institutions in my country reversed it's decision to phase out ColdFusion (the theory was to replace it with more Java development).

What they eventually found was that CF was generally faster to deployment. They're now ramping up CF with enterprise-wide (ie unlimited) enterprise (ie the CF version) licenses.

In other words, Java couldn't match ColdFusion in satisfactory outcomes if that's what the 80% was measured in. Don't get me wrong, Java is still there as well as .NET but ColdFusion is now the preferred platform, probably because 80% of the time it's the best "fit".

and I reckon, 80% of the time they're right which will 100% do for me!
# Posted By barry.b | 6/3/07 7:45 AM
With CF8 comes the ability to write Ruby (or any other language for which you can find a JSR 223 implementation) directly in the middle of your CF code, so now you can be profitable and cool simultaneously :-)

As for the CF AJAX tags; the ExtJS library that provides them also includes proxies for Prototype/Scriptaculous, jQuery and YUI, so most of the work necessary for that extra 20% is already done. CFCs can now return JSON natively too, so a complete custom solution is also very easy to achieve.
# Posted By James Holmes | 6/3/07 8:12 AM
@Barry, great story and perfect example of the ideal class of use case for CF.

@James, I've seen what Sean is doing but I'm still trying to grok what the practical use cases will be for this - Ruby (or PHP) in CF is a cool idea, but I think the devil will be in the details for this. Thanks for the JS info.
# Posted By Peter Bell | 6/3/07 11:30 AM
While I haven't looked at the Ruby implementation, the PHP one (Quercus) actually allows for a J2EE server to run entire PHP apps. phpBB, Wordpress, Drupal and a bunch of other things all run fine under it; just add a serlvet mapping to process *.php and that's about it.

http://quercus.caucho.com/

I'm going to try a deployment inside an instance of JRun on my desktop, just for some fun. If I knew a single thing about Ruby I might be of more help there too.
# Posted By James Holmes | 6/3/07 2:05 PM
I'm seeing a lot of companies back off from Java solutions and move back to ColdFusion. Why?
Speed of development and structure. I disagree with your 80% analysis. Even for complex intranets CF handles more like 99% and it does so with structure. What I mean by structure in this case is a standardized high level format that allows one developer to quickly read, understand and contribute to another developers work. Combined with significanlty fewer bugs compared to Java or C# development (a function of the skill of the programmers but we live in the real world), the new ability to work seemlessly with .net, the much more rapid development time, the power and scaleability and the backing of Adobe and you have a compelling business case. Nothing else makes sense to me.
# Posted By StudioBTM | 10/11/07 1:10 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.005.