For years, Adobe ColdFusion has added feature after feature that has dramatically improved productivity for CFML developers. With CF8, support for struct and array literals was added as well as improvements for operators (ability to use <= instead of LTE, ++ for incrementing, etc). With CF9, they added support for full-script CFCs. Well done, Adobe.
I’d like to hear from you: what other enhancements would you like to see to the core language? What drives you nuts that you wish you could change (var scope, cough cough). What is missing? What’s half-baked? I’m not talking about features or new tags or functionality … purely language-level stuff. As a coder, what do you wish you could do with CFML that you can’t do today? Perhaps you’ve worked in other languages and encountered semantic constructs that you miss when working with CFML?
This is strictly for my curiosity: I don’t work for Adobe, and I have exactly Zero Pull (tm). I have a list of enhancements I’d like to see made to CFML, and I’m curious how your wish list compares with mine.
Thanks!
15 comments:
Marc, can you publish your list?
Two things that would be super cool:
1. App-specific JAR paths ala this.mappings or this.customTagPaths. It would be create for each application to get its very own class loader based on that.
2. App-specific way to update the list of globally-defined functions. I think Railo has something like that were I can basically add to the core set of functions.
My #1 request would have to be revisiting the whole cflogin set of functions. Get the whole single-sign-on thing working more reliably. Create a script equivalent.
#2 Better documentation. Especially the code samples and script reference material. At least put script and tag references on the same page.
#3 Allow properties in components to set a default value.
@Mike - I'm a bit curious about your better doc comment. You mention that you want both the tag and func ref on the "same page' - but you are aware that would be huge, right? The HTML based docs provide a list of them and quick links to the full docs. Did you mean something else? Of course, if you use the PDF, you can jump to any thing quickly.
Rob, I'll definitely publish it eventually, but I didn't put it in here b/c I don't want to "front load" people.
Mike, I love you man. But I wouldn't put #1 or #2 in the "CFML Language Improvements" category. #3 is an excellent example, though!
@Ray, I think you misunderstood what I was looking for in the cfdocs. What I would like to see is decent cross-references for the script equivalents in the cfml reference. For example, when you pull up the reference for cfdump, there would be a link to the page for writedump. I see it as something very similar to the "see also" line.
When I mentioned putting script and tag references on the same page, I didn't mean to imply that tag and functions should be on one gigantic page. One logical page per command is fine with me. It was more about better documentation for the script equivalents of tags.
@Marc, Oh, you were strictly talking about CFML, and not specifically the ColdFusion product. It's hard to keep those separate in my head sometimes.
There's a Google Group where folks can discuss the language enhancements they'd like to see as well:
http://groups.google.com/group/cfml-conventional-wisdom
@Mike- ah yeah, that makes sense, and I agree 100%. It would be very useful.
ANONYMOUS FUNCTIONS AND CLOSURES!!!
CFML has had functions as first-class objects for years now: you can assign a UDF or CFC method to a variable or pass it as an argument to another method or function, and invoke it through the new variable or argument. But without the ability to define anonymous functions, it's very hard to make good use of this feature.
Of course, to bring some real power to CFML functions, it would be hard to beat closure support. Anyone who has played with jQuery should know how powerful closures can be. It's not like closures are anything new: I used closures back in the 90's when I was programming in Perl
Martin Fowler has a bliki entry on closures that offers a brief introduction and explanation of why they are so awesome. Of course you can also find references to closures in this very blog.
It would be preferred if the "variables" and/or "this" scope in CFML were treated as lexical scopes for closures (that way CFC methods could double as closures), but if this caused backwards compatibility issues I'd be OK with adding a new lexical scope for closures.
i would LOVE a way to reliably split up a massive CFC into smaller parts. using cfinclude right now works as long as you aren't extending a cfc that has cfincludes and then try to overload a method in the extending cfc. something like .net partial classes would REALLY help.
also on the wish list is support for blocks and modules (ala Ruby) :)
I agree with Mike on all counts.
I, for those who have heard me whinging, obviously want to see the language enhanced to accomodate more choice by allowing including javascript files so the client and server can reuse code from each other. Like what Alan at OpenBD has been working on.
jQuery server side, now THAT would be a language improvement!
1. lambdas/closures
2. static-like imports
3. final and immutable data abstractions
4. optional semi-colons and parens
5. static API doc generator ... like Javadoc
I would like to see the JavaDoc syntax for attributes and metadata deprecated and a better syntax introduced. I like the square bracket syntax of ActionScript, but anything other than comment syntax would be great. I'd also like to see safe navigation via the ?. operator, ala Groovy.
Post a Comment