CFX: Feature Requests Part 2 – New Tags & Functions

Before we get into the tags, I’d first like to mention I firmly believe SES URLs need to somehow make their way into ColdFusion.  The root of ColdFusion is making development life simple, and there is nothing simple about setting up SES URLs, particularly if you don’t know regular expressions.  I think this should be enabled/disabled at the application scope level and be a well thought out, simple process that doesn’t require IIS or Apache URL rewriting… it’s all done seamlessly in CFX.

With that said, here are some new tags I’d like to see:

  • CFTRAIL – This will leave a breadcrumb trail.  I initially thought this would be a feature that would require the use of SES URLs in the application scope, but thinking further, I think it could still be done with the developer providing parameters.
  • CFBROWSER – Web browser detection baby!

And while we’re at it lets add some parameters to CFLOCATION to allow delayed cflocating:

<CFLOCATION from="now()" delay="dd:hh:mm:ss" />

Lets also add a parameter to CFDIV to allow that loading icon to be customized:

<CFDIV icon="/images/yourAnimatedIcon.gif" />

This being ideal for loading user custom-created pages from a database, I think one of the features I would use the most is the ability to loop over cfcase in a cfswitch:

<CFSWITCH expression="#whatever#">
<cfloop query="yourQuery">
<cfcase value="#query.Column#"></cfcase>
</cfloop>
<cfdefaultcase></cfdefaultcase>
</cfswitch>

And finally some new functions I’d also like to see:

  • dollarformat() – oops!  Already exists.
  • encryptStruct()
  • encryptArray()
  • queryToArray(my.query,[dimension])

Coming next week
CFX: Feature Requests Part 3 – Everything Else

5 comments

  1. Dude, check your reference. There is a dollarformat.

  2. Anonymous says:

    Not exactly sold on making SES/breadcrumbs a responsibility of the framework/application instead of the application server itself.

    Are you sure about that function?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7b05.html

    Serializing the struct and encrypting it in a second step seems preferable to adding another function which is essentially just a wrapper (though the same can be said for all the different currencyFormat functions).

    And in the ACF it’s essentially possible to use possible to use a query as an associative array which contains the actual values as one-dimensional arrays in its elements. Not sure if Railo has finally implemented that as well, but last time I checked they still required the valueArray() workaround.

  3. Rick Smith says:

    ah you both got me… there sure is a dollarformat().  My bad.

  4. Tony Nelson says:

    In a previous post, you said you were an anti-framework guy, but if you want SES URLs and breadcrumbs, most good frameworks will make these really easy to do.

    Honestly I don’t think I agree with any of any of your feature requests, as most of the them involve decisions that should be left up to the developer or can already be accomplished in a different way (switch vs if).

    To me, feature requests should mainly involve language constructs, such as adding support for closures, blocks, implicit getters and setters, lambdas, additional native serializers (xml, yaml), statics, constants, etc… – things that cannot be easily created by a developer or provided by a framework.

    • Rick Smith says:

      Yes, I’m an “anti-framework guy”, but that doesn’t mean frameworks shouldn’t be included with CF, which is why I tried to propose a logical solution to make them available to those who wanted them AND those who did not.  I’m a firm believer CF is about making life for developers easier, which is what I’ve felt was the foundation of the language since its Allaire days… maybe I’m wrong.

      Yes, you can loop over an if statement vs. a switch.  I personally prefer switches over loops anywhere possible.  Does that mean it’s right… I don’t know.

      I’m far from the best ColdFusion developer out there, but I do consider myself quite adept with the language.  Although I agree all of the things you mentioned in your last statement should be included, I disagree that ColdFusion should be limited to those things and I think ColdFusion has clearly proved that theory many times over in the past… such as including ExtJS to use AJAX (as opposed to letting us choose our own AJAX environment… I prefer jQuery, but honestly I do use a combination of the built-in ColdFusion ExtJS AJAX stuff along with jQuery… CFDIVs are awesome).  The same goes for searching with SOLR, Flash forms, XML forms and so on.  Some of these features die out as time progresses, others do not (I genuinely miss Flashpaper).  These things ALL of course could have been “left up to the developer or can already be accomplished in a different way”, but were included to make ColdFusion better.  ColdFusion has historically included the latest trends and technologies with each release.  If CF strictly adhered to what you mentioned, the language couldn’t be as robust or mature as it is now (my opinion).

      With that I stand my ground and firmly believe SES URLs and breadcrumbs would be EXTREMELY useful for many developers and certainly make ColdFusion more attractive to newer developers.

Leave a Reply

Your email address will not be published. Required fields are marked *