Thursday 2 January 2014

A quick survey about tags & script in the same statement

Here's a quick survey for y'all: '"Closure" confusion'.


As one of my respondents observed... the question has nothing to do with "closure" but is entirely relating to anonymous functions / function expressions. For better or for worse, people use the term "closure" incorrectly to describe these things. A function expression implements closure, but there's no such thing as "a closure" (no matter how many people will it to be the case). Closure is not a countable noun; it's a concept. I am fully aware of this, I was just mocking Adobe's usage of the term. Hence me referring to it in quotes.

The narrative for the survey is as follows:

This is a quick survey to determine how clear some suggested CFML syntax would be. It relates to the bug tracker issue described here:

The contention is that the suggested syntax would be confusing for CFML developers.

I am just wanting to gauge your thoughts on this.

I will collate the responses after I have received a reasonable number of them, and post them on my blog.


Adobe's contention is that this syntax is confusing:

<cfset c = function(){ 
    var a = something;
    var b = foo();
    return a * b;

This is because it's a tag, but it contains CFScript syntax to define the function expression.

My contention is that that is not confusing at all.

If there was a demographic of CFML developers who would find that sort of thing confusing, then they're not likely to be the sorts of developers to be using function expressions anyhow.

Still: my opinion is based solely on instinct. I figure it's better to get people's opinions. I know the temptation might be to declare "of course it's not confusing", not wanting to sound like one has any shortcomings. But it's a reasonable question: not everyone uses CFScript all the time, and there is that whole mix of tags / script going on there. Please answer honestly. It's anonymous.  I will, however, be publishing the results (but who posted what answer is anonymous even to me, so don't let that influence your honesty!).