Justin Carter has posted thoughts on using CFML within <cfscript>, using (what he calls) C4X. While I must (once again) confess not not being a big <cfscript> fan (I was actually opposed to many of the enhancements made in recent CF editions, I'd have much preferred we deprecate <cfscript> in favor of server-side ActionScript), Justin's post makes for an interesting read. We've been debating the future of <cfscript> since it was first introduced back in CF4 in the 90s, and I think we'll be debating this one still for some time to come.
Seriously, there are some good arguments on both sides and i don't think there's a good/bad answer.
I have to say that I'm not a big fan of the current implementation of cfquery in cfscript in CF9. For me, the benefit of less verbose code in cfscript just goes out the window when it comes to queries. So I'm thinking C4X may be a good alternative until Adobe improves on this.
The server-side ActionScript idea has been thrown around a few times, and I know Adobe has demoed it before at one of the MAX conferences (was it 2009?), but whether or not it's a great fit for CF in terms of *replacing* cfscript is a huge can of worms!
The topic deserves more than a few comments from us here, but a few points worth considering include;
- What problems does cfscript have that ActionScript would solve? (And in this case, would it inherently solve the issue of verbosity of cfquery, or allow the use of custom tags?)
- Would changing to ActionScript actually bring important new features and improve developer productivity?
- Why not server-side JavaScript instead/as well? (Wouldn't JavaScript's developer base be larger than ActionScript's? There's a target market right there!)
- ActionScript and JavaScript both support E4X, so wouldn't C4X fit right in? ;)
Personally, I think I'd stick with cfscript or tend towards server-side JavaScript before wanting to use server-side ActionScript, depending on how radically different it was (i.e. AS3?). I'd be interested to see some blogs which had strong thoughts about it one way or the other.