Friday, 29 August 2014

Example of the thoughtlessness of a generic tag to CFScript solution

G'day:
I've repeatedly said that Railo and ColdFusion's way of implementing 100% CFML functionality coverage in CFScript was lazy, leaden, and detrimental to the language. Here's an egregious example.

Wednesday, 27 August 2014

What would you do?

G'day:
Here's a quick one.

If you had a requirement to have a function which returned two things: a result, and optionally some telemetry on the process being run; and there were two distinct bits of data, and the nature of the requirement is such that the telemetry cannot pollute the return variable. How might you do that?

Saturday, 23 August 2014

<cfmodule> in CFScript: does this behaviour make any sense?

G'day:
I'm in the process of documenting all of CFScript. Well: how to effect all of CFML's functionality in CFScript, really.

Today I'm looking at how <cfmodule> is handled in CFScript. Railo and ColdFusion implement it differently (although Railo also implements ColdFusion's implementation for sideways compatibility).

And I am puzzled with the way ColdFusion handles it.

Friday, 22 August 2014

Have found some evidence for that "There was an error accessing this page. Check logs for more details." issue in CFAdmin

G'day:
I dunno if you've had this before, but I fairly frequently am confronted with this whenever I try to change something in CFAdmin:


This is after I successfully login, and can click around no worries, but as soon as I go to change anything, I get this error. This is a concern because it looks like there's a disconnect between CFAdmin's authentication (logging in) and authorisation (what one can do once logged in).

ColdFusion 2016

G'day:
Whilst some of the Adobe ColdFusion Team are pantsing about trying to take as long as possible to fix ColdFusion 10 and 11 bugs, other elements of the team must surely be planning ColdFusion 2016. Adobe have completely failed with their increased-frequency release cycle, but they are undoubtedly still moving forward.

Each CF release people blog "ColdFusion n wishlist". I've just googled-up articles such as:
One thing though - and I didn't check the dates on those articles specifically - we only tend to start thinking about what should go in this next version of ColdFusion Adobe are developing once the cat is out of the bag that they are developing it. By the time whispers of the next version of ColdFusion reach the gen. pop., I suspect most of the features and general gist of the release is already at least written-, if not locked-, down.

Wednesday, 20 August 2014

Go and vote, pls

G'day:
Sorry for the silence recently... my life is getting very... complex of late.

Anyway, Adobe are playing at silly buggers with a bug that they're dragging their heels about, and they are saying it needs more votes to get more attention.

It's to do with CFClient, but just on principal, I've voted for it because they need to stop with these sloppy implementations. Hopefully you think likewise, so will go vote for this: "queryExecute params not working in mobile".

Sloppy, inconsistent implementations ought not need votes to get fixed. Adobe ought to have more pride in their work. But if instead they need votes... let's give them votes.

Cheers.

--
Adam

Thursday, 14 August 2014

Utterly off topic: my other twitter account

G'day:
I try to keep my @daccfml Twitter account on-topic for CFML / IT type stuff: it's the Twitter adjunct to this blog. Sometimes I mess up and send off-topic updates from it, but on the whole I like to try to keep the off-topic stuff restricted to my other Twitter A/C: @dacactual.

One of the topics I comment semi-regularly on via @dacactual is my own lack of superstitious beliefs, and "gentle" piss-taking of people who have them. I often retweet messages from scientists, active atheists and pisstake accounts (@theTweetOfGod, etc) which represent my opinions, or I find interesting or funny. Sometimes I pass my own comments. I also talk / post about a bunch of other stuff on a semi-regular basis: movies I've watched, beer I've drunk, scientific articles I've read (particularly ones that challenge junk-science).

Wednesday, 13 August 2014

Even newbies can help solve community problems

G'day:
I was quite pleased yesterday when I got my first "accepted answer" for a Ruby-tagged question on Stack Overflow. I hasten to add that the question was one of converting CFML code to Ruby code, so I had a helping hand, plus it was simply a matter of seeing where the logic of the Ruby code didn't match that of the CFML. I think even someone not versed in Ruby at all could answer it. So I'm not claiming it as much of a personal achievement.

What is good about it is that it demonstrates that answering questions on Stack Overflow is not the sole purview of experts in a given field; even newbies and intermediate-levelled people can provide good input into other people's questions. Also, it's a great learning exercise. Stepping out of one's own comfort zones and into someone else's problem domain exposes us to technology and concepts we might not use every day. The code we use at work is very five-tagger (perhaps "ten-tagger" might be a better description; reading "Five-tagger? what n-tagger am I?"), and I never use CFML's UI tags, PDF tags, image-processing tags, spreadsheet tags, .net integration, etc. So when I see someone asking a question on those topics, it's a good excuse to roll my sleeves up and find out what the answer is. This helps both the petitioner as well as myself. Win. So imagine if you're a less experienced CFML developer (purely chronologically, I've been doing CFML for 14 years, so I have picked up a reasonable amount of knowledge along the way, so I don't think it's hubris to imply I'm "experienced"), there is even more scope to learn more new stuff.  Don't use CFCs? Check how people are using them in the real world. Don't use CFScript? There's a lot of CFScript code on show on Stack Overflow. Have never used a "closure" in your life? Here's your chance to see them in action.

Friday, 8 August 2014

More on <cfcatch>: Java exceptions

G'day:
This is a very quick appendix to this morning's article "<cfcatch>: my ignorance is reduced. Over a decade after it should have".

How about java exceptions? Well ColdFusion and Railo behave differently here.

CFML: <cfcatch>: my ignorance is reduced. Over a decade after it should have

G'day:

Update:

I had to take this article down for a few hours as I ballsed up both the code and the analysis! Thanks to Adam Tuttle for noticing (or making me revisit it so I noticed it, anyhow).

It pleases me when I learn something I didn't know about fundamental parts of CFML. I temporarily feel daft, but I'm used to that.

Ray - amidst a fiery exchange of disagreement last night - set me straight on a feature of CFML's exception-handling that I was completely unaware of. Despite it being well documented. Since ColdFusion 4.5. Cool!

I had never noticed this from the <cfcatch> docs:

The custom_type type is a developer-defined type specified in a cfthrow tag. If you define a custom type as a series of strings concatenated by periods (for example, "MyApp.BusinessRuleException.InvalidAccount"), ColdFusion can catch the custom type by its character pattern. ColdFusion searches for a cfcatch tag in the cftryblock with a matching exception type, starting with the most specific (the entire string), and ending with the least specific.
The "funny" (at my expense) thing here is that not only did I not know that, I had actually wanted <cfcatch> to work that way, and just ass-u-me`d it didn't so never tried it! Fuckwit.

Here's an example:

Wednesday, 6 August 2014

PHP's error "handling". Oh dear

G'day:
OK, so I am gonna side track into error-handling in PHP. During the writing of the previous article ("Looking at PHP's OOP from a CFMLer's perspective (part 1/?)") I needed to try to try/catch some stuff, and ended up having to learn a fair bit about how PHP implements error handling. Which is a bit of a horror story.

Looking at PHP's OOP from a CFMLer's perspective: classes, objects, properties

G'day:
Once again I find myself looking at PHP. As an exercise, I'm gonna get up to speed with how OO is effected in PHP, and as a learning aid I'm gonna document it as I go. I hasten to add I am very much a PHP newbie so if I was you, I'd take what I say with a grain of salt. And if yo see anywhere I go wrong: please let me know.

I am working through the docs on the PHP website: "Classes and Objects", but I won't necessarily be commenting on it in order; rather more as I find out stuff, I'll jot it down. And I'll probably need to enlist the help of Google and Stack Overflow too.

Tuesday, 5 August 2014

CFML: <cfchart> / <cfchartseries> bug details for Adobe & Railo

G'day:
I need a place to put some pictures for a coupla bugs I need to raise, so I'll slap 'em in here and point Adobe & Railo at them. There's not much of interest going on below the fold, so don't bother reading it if you have something better to do.

CFML: What was that array.each() quiz all about?

G'day:
Yesterday I posed a quiz question to you: "Quick quiz: checking your expectations", which was asking how you'd expect this code to behave:

//each.cfm
a = ["a"];
a[3] = "c";

a.each(function(v,i,a){
    writeOutput("value: #v#<br>");
});

Why was I asking?

Well because on Railo it behaves like this:

value: a
value: c


Whereas ColdFusion 11 behaves like this:

value: a

The web site you are accessing has experienced an unexpected error.
Please contact the website administrator. 


The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request

An exception occurred while calling the function each.

Variable V is undefined.

Monday, 4 August 2014

Quick quiz: checking your expectations

G'day:
This is a super quick one. What would you expect this code to output:

//each.cfm
a = ["a"];
a[3] = "c";

a.each(function(v,i,a){
    writeOutput("value: #v#<br>");
});

This is not a trick question, and I'm not looking for "clever" answers. I just want to know - all things being equal - what output you'd expect here.

What info I'm after here is just which way people's expectations tend, not who's right or wrong.

Answers on a postcardin a comment, pls.

--
Adam



Sunday, 3 August 2014

CFML: That <cfexit> bug I thought I had spotted: solved

G'day:
Yesterday I asked for some help understanding a mismatch between some code and some docs: "Are the docs for <cfexit> wrong, or am I misunderstanding?".

I just looked at this some more, and discovered the docs are right, Railo is right, and <cfexit> is right. However there's still a bug in ColdFusion...

Here's a refined repro case:

<!--- testusingCfimport.cfm --->
<cfimport taglib="." prefix="t">
<t:basic>
    Text within tags<br>
</t:basic>
<hr>

<t:basic exitMethod="exittag">
    Text within tags<br>
</t:basic>
<hr>

<t:basic exitMethod="exittemplate">
    Text within tags<br>
</t:basic>
<hr>

<!--- basic.cfm --->
<cfparam name="attributes.exitMethod" default="">
executionMode: <cfoutput>#thisTag.executionMode#</cfoutput><br>
<cfif thisTag.executionMode EQ "start">
    <cfif len(attributes.exitMethod)>
        exitMethod: <cfoutput>#attributes.exitMethod#</cfoutput><br>
        <cfexit method="#attributes.exitMethod#">
    <cfelse>
        exitMethod: not specified<br>
        <cfexit>
    </cfif>
</cfif>

Saturday, 2 August 2014

Railo: CFC-based custom tags

G'day:
As a baseline for some more research I am about to do, I wanted to get up to speed with how Railo implements CFC-based custom tags. I had read their blog articles about them:
But it hadn't completely "sunk in" for me just by reading. I decided to work from top to bottom of the technology, demonstrating to myself all the various facets of custom tags and how they are implemented via a CFC. And here it all is...

Are the docs for <cfexit> wrong, or am I misunderstanding?

G'day:
Just before I update the ColdFusion docs and file a bug with Railo, can someone please santiy check this.

Friday, 1 August 2014

Don't advertise yourself as a CFML website

G'day:
Do you know what the first thing I do when I see a website which uses .cfm file extensions is?