Saturday, February 07, 2009

Ideas for CFML improvements, less tag bloat!

Following on my CFLOCK type="parallel" idea, i was working a session cfc today and was about to do some CFLOCK'ing for a few things. It dawned on my that perhaps adding a option to CFFUNCTION

<cffunction name="setRating" returnType="void" lock="session|name|application|server"
access="public" output="false" lock>

Would be a nice language improvement, the easier that locking is, the more developers will use it and it could help reduce the verboseness of CFML.

Sounds like some interesting things are on the way for CF9 which sound good. Ray had a poll on his block about whether or not you would use CFSCRIPT exclusively for your CFC's in CF9 ( which can ). I don't mind tags for the component and function lines myself at all.

Adding LANG="CFML|CFSCRIPT" to the CFFUNCTION statement which would remove two redundant CFSCRIPT tags! heck make it an option on CFCOMPONENT!

Talking of CFQUERYPARAM, here's hoping for a new CF function bindVar'ish as a functional equivalent, coz they are way to long for such oft repeated tags. Aliases for these tags like CFARG and CFQP would also nice.

OR could we just overload CFPARAM with cfsqltype="CF_SQL_VARCHAR etc but (again VARCHAR should suffice on its own!)" and null="yes|no|auto"?

kinda neat, plus you get the validation stuff all in one place should you need?

or lets face it, why add a not make cfcs just return a bind parameter inside inside the cfc. CFQUERY creates a bind parameter, why do we need a return type anyway? that could just become the default inside a CFC.
DATE_REVIEWED=<cfqueryparam value="#document.getDateReviewed()#" cfsqltype="CF_SQL_VARCHAR">,

becomes

DATE_REVIEWED="#document.getDateReviewed('timestamp')#"
now that's a lot less diverse, hey CF can guess a type for variables, why not let it automatically decide as well
DATE_REVIEWED="#document.getDateReviewed()#"
Adding scope="cfc=document" to CFQUERY could then reduce that to just
DATE_REVIEWED="#getDateReviewed()#"
So I guess I'm saying with CF code, I love the structure of it, it's just a bit verbose at times.

Your thoughts?

Also CF9 really needs native support the for the java classloader stuff, imho.

BTW it was 46.4C today in Melbourne, Australia! phew

No comments: