Full CFScript CFCs Aren’t Yet Where They Need To Be
A few months ago, I blogged about my excitement about the role that full script CFCs could have in an MVC stack, particularly with ColdFusion on Wheels. In my excitement to try out the new feature, I had spent much of a Saturday manually converting all of my components into CFScript components in a project that I am working on.
Unfortunately, the CFScript part of ColdFusion isn't quite where it needs to be yet.
Don’t get me wrong: CFScript is much improved over where it was in previous versions of ColdFusion. And I don’t get angry when I experiment with a feature and it doesn’t work out, but I also try my hardest to know when to back off and undo any damage before it goes too far.
What didn’t work
As it turns out, doing custom database queries in CFScript is very cumbersome. It starts feeling a little too much like PHP. Maybe even worse!
Consider this beautiful, expressive simplicity that we all love about CFML:
And replace it with this garbage:
The last line is the part that really gets me. What is this, Java?
Also, it gets much worse when you need to cut in and out of the SQL string that you’re building in order to add in
if logic, loops, calls to
The other big annoyance to me is CFScript’s lack of coverage for many of the other data communication tags. It hurts to not have equal functionality available for
cfldap, etc. I need to call more than just databases in my models and controllers.
Realization: I need to support Railo too
I need to work on adding support for Railo, which doesn’t yet support full script-based components anyway. So it was probably in my best interest to take some time to convert my components back to CFML again.
Perhaps our paths shall cross again some day, CFScript. Until then, I bid you adieu.