Subsribe to our RSS

latest reactions

christian louboutin shoes
With that kind of traffic you want to ad …
Rahul Anand
Thanks for the nice post. It works for m …
Serkan
thx a lot! …
msb
Thanks for above solution.There is ano …
Lori S.
FYI, I was using this successfully in CF …

Use OpenDNS

mxna feeds

cfmailparam behaviour change in CF9.01ColdFusion Job Opportunity in Houston, TXFacial Recognition in 14 Lines Of ColdFusionColdFusion UPS PackageColdFusion Job Opportunity in Arlington, VAColdFusion Job Opportunity in San Diego, CASome ColdFusionBloggers.org GuidelinesColdFusion Positions In CaliforniaListChangeDelimsunix epoch with coldfusionQuery scripting bug in Coldfusion 9Scoth On The Rock 2011 Tickets on salefoursquareCFC updated to version 1.0, now includes ColdFusion return typeFramework One Birds of a Feather session at CFUnitedWhat makes you a good ColdFusion programmer?

All files are strictly confidential: all information is classified.
© Copyright 2002 - 2010 mximize.com.
All right reserved.

MXNA webfeed

Visit Carlos Gallupa

Stop whining for scripting support

In several articles people start asking for better scripting support in ColdFusion version 9. I hope from the bottom of my heart that this will not happen. ColdFusion has been and hopefully always will be a tag-based language and if you like scripting start using JSP or JAVA together with ColdFusion or not.

Scripting is killing for the language. It doesn't make sence to use scripting in a language that uses tags.. it's total chaos if you look at some of the applications where tags and scripting is used for the only reason that it is possible to do so... And don't say it's easier to set variables as arrays and structure because it isn't. For logical and "clean" coding we all need to be doing the same thing and that's using tags for this purpose, this way every other CF developer will understand what is being done, even the once that just startout using CF.

The language would be better of to be more strict about the use of it's tags and variables, then keep adding support for programming in different ways.

My humble 2 cents

2650 viewed | 22 opinion(s)  | del.icio.us | Digg it | Tjarko @ 05/02/09 10:04 cet


Reactions:

Mingo Hagen wrote.... (site)

Hi, I'm Mingo and I am a cfscripter.

[group]Hi Mingo[/group]

05 February 2009 12:52 cet  

inj wrote.... (site)

Hi,
I can not agree with your opinion that "Scripting is killing for the language". Instead, allow the script to write code much faster. Also, it is much easier than using the tags.

05 February 2009 14:56 cet  

Tjarko wrote.... (site)

Hi Inj, My rant is about the fact that ColdFusion always has been a tagbased language since the start, this makes the language easy, quick and as simple als buttering a sandwich, even when it's a warm sandwich.

Scripting is everything but simple and understandable. This is the whole reason why ColdFusion exists, that scripting is to darn hard to learn and read.

If not, and I'm talking jibberish use JSP, a scripting language based on JAVA... Hee!! sounds familiar... doesn't.

05 February 2009 15:42 cet  

Mike Rankin wrote.... (site)

Stop bemoaning the arrival of better script.You're going to have to deal with it because it's coming: http://www.coldfusionjedi.com/index.cfm/2009/2/3/This-is-ColdFusion--this-is-ColdFusion-100-in-Script-on-Bolt

I guess you're not a big fan of Flex either since it uses mxml(tag based) and .as (script based) files.

05 February 2009 16:27 cet  

Tjarko wrote.... (site)

Hi Mike, I've been using ColdFusion for about 11 years now, have all the certificates and gave courses as a advanced certified instructor and Flex has nothing to do with ColdFusion, that's flash.

And no, I don't have to deal with it because in 11 years programming I have never had the need to use it. Why use scripting... why?? Because it's cool?? harder to read... totally besides the point of a tag language... why?? Nobody can seem to answer that, give me one good reason why I should use scripting and I will start programming in PHP, JSP or any other totally scripting based language.

I love, yes love ColdFusion for the fact that it's as simple as it is because of tags, why would you wanna change that? Because you can do more?? No.. you can already do that by using beans, components, jsp etc etc...

But I will stop "moaning" as you call it ;-) I just don't see the benefits of scripting support.

05 February 2009 16:46 cet  

Brian Kotek wrote.... (site)

As others have pointed out, this is absolutely coming in CF9. You can choose not to use it if you like, but it will be there.

Tags are nice for writing display code. They are awful for writing business logic. Why use scripting? Because writing CFCs in a tag-based syntax is unnecessarily time consuming and verbose.

If you think a tag-based CFC is easier to read than a script-based one, I'm afraid that staring at tags for so long has affected your judgement. And if you think that writing a tag-based CFC is easier than writing a script-based one, then I'm going to assume you haven't had much experience with non-tag-oriented languages like Java or ActionScript. If so, that means that *you* think it's harder simply because you're so used to tags.

I'm sorry, but if you think that this:

<cfcomponent>
<cffunction name="init" returnType="void">
<cfargument name="dsn" />
<cfargument name="user" />
<cfargument name="password" />
<cfset this.dsn = arguments.dsn />
<cfset this.user = arguments.user />
<cfset this.password = arguments.password />
</cffunction>
</cfcomponent>

Is easier to write or to read than this:

component {
public void function init(dsn, user, password) {
this.dsn = arguments.dsn;
this.user = arguments.user;
this.password = arguments.password;
}
}

then our standards of clarity and conciseness are vastly different.

I'll go out on a limb and say that if you choose to learn and use the script syntax for business logic, you're going to change your mind rather quickly.

05 February 2009 19:30 cet  

Tjarko wrote....

Hi Brian, txns for your comment. I do not agree with you but again. It seems that even diehard coldfusion users as yourself rather change the language then embrace the simplicity of it being tag based, i find this disturbing. It's probably just me that totally doesn't see the need for scripting, let's call it a flaw in my thinking :-) but two ways of doing the same thing isn't an improvement for the language, again my humble opinion.

05 February 2009 19:52 cet  

Brian Kotek wrote.... (site)

I understand, but I still think you may well change your mind once you try it. Consider that in the small block of code I showed above, the tag version took 50% more code than the script version. That's a huge difference.

05 February 2009 20:09 cet  

Tjarko wrote....

That's true, and i like short and simple coding. That is the only reason for me to use coldfusion in the first place. And if the use of changing the language to better scripting possibilities is the best thing since sliced bread i will be the first to shout that out, i will even update this posting saying i was wrong. But for now.... ;-)

11 years of defending coldfusion being tag based maybe effected me an bit :-)

05 February 2009 20:29 cet  

big rig wrote....

i agree that it should be tag-based but i disagree that we need to remove scripting altogether... however, what has bothered me for awhile is that CF seems to be slowly mutating into another language altogether. if i had wanted to learn java or some other language, i would have done that 7 years ago rather than spend all this time learning and then selling CF sites. the language gets more and more complicated and the time to create an application gets longer and longer if you try to maintain good practices and latest standards. what drew me to CF in the first place was that is was tag based and quick to market. if tag based support were completely removed, i would not even use CF anymore... seriously... because it would not be CF anymore. as long as there is support for both, then we can all script or tag as we wish and still build nice applications...

06 February 2009 0:16 cet  

Chris wrote.... (site)

@Brian

no offense intended, but, can't you accept that some people just don't like the script syntax even IF they have the experience you say Tjarko has not? What is easier to read may well be a matter of personal preference.

It's a little like those people that say in script curly braces must not be placed like this, because it's harder to read.
if(a==b)
{
do something;
}

Some prefer this style, some prefer yours. So what? You could as well say that someone that insists on script syntax is a bad developer, because he lacks the flexibilty to read/write another coding style. And you would be as wrong as you are with the statement that someone that prefers tags is not as experienced a developer as a scripting guy.

And if you compare the amount of code, it's not always in the favour of script. I am sure you have read Ray's blog post as well:
q=new query();
q.setDatasource('#myDSN#');
q.setSQL('Select...');
q.addParam(name='myID', value=myVar, CFSQLTYPE="CF_SQL_integer");
q.execute;

all this vs. one <cfquery>-and <cfqueryparam>-tag...

And before you claim that I don't know scripting well enough: I have been developing applications for 28 years now, the majority of this time I had to use some kind of scripting syntax. I do my share of Flex development as well as CFML development. But, I still prefer CFML over AS-style syntax.

06 February 2009 9:44 cet  

Chris wrote.... (site)

Sorry, had to split the comment, because the combined version was too long. ;-)

@big rig

"the language gets more and more complicated and the time to create an application gets longer and longer if you try to maintain good practices and latest standards. what drew me to CF in the first place was that is was tag based and quick to market"

Well, people always demand new features and often enough you can not avoid added complexity with new features. On the other hand, yes, RAD has been one of CF's unique selling points and making the language more complicated is moving away from RAD.

My take on this: If I don't like the way I have to write an application in language X, I use language Y. If I don't like CFML, I use .NET or PHP or Java or Ruby or whatever. There is no need to transform one language into another, because they will loose the unique features and it won't matter any more what language you use. And that may well mean less sales for CF.

Personally I think that the script support was not necessary at all. Just because it's someone's personal coding style does not make it better. It's just that the people that "demand" the scripting enhancements are very vocal.

My 2 cents.

06 February 2009 9:45 cet  

tony petruzzi wrote.... (site)

i've pointed this out before. I don't think a lot of coldfusion programmer dislike scripting because of the syntax, i think (and i personally) they don't like it because the tag based syntax and scripting syntax are incompatable. let me give an example.

suppose you are writing a function that need to return so code wrapped within a cfsavecontent tag. you have not choice but do this with tags and currently there is no way to do this with cfscript.

this is the problem that cfscript has caused over the years and it needs to be addressed. very often i see code that goes back and forward between the two syntaxes because there is no cfscript equivalent to a tag. sure a lot of people just write their own udf to map tags to functions for cfscripting, but the fact of the matter is that if your going to include two syntaxes in a language, make the two syntaxes able to handle all portions of the language.

06 February 2009 14:17 cet  

John Farrar wrote....

So seriously what is your take on JavaScript. Do you think it would be better to replace JavaScript with a tag based language also?

06 February 2009 15:11 cet  

Tjarko wrote.... (site)

No off course not???? I think your missing the point. ColdFusion IS tag-based, has been for over 11 years. JavaSCRIPT... hence the name, IS a scripting language. I totally don't see the need for that question??

Your question is the same as asking if actionSCRIPT should be tag-based?? no.. that's also a scripting language.

06 February 2009 15:36 cet  

John Farrar wrote....

Thank you for pointing out 1) why you don't see the need and 2) for commenting on ActionScript... :)

Flex can be written 100% in ActionScript. Yet, there are a large number of developers who prefer to write in tags. MXML is the tag way to write Flex or AIR apps that get converted to script before they are made into a swf.

It is a common thought to put the design/view in tags and put the logic in script. If you prefer logic in tags that is OK with me. If I prefer logic in script you would rather tell me to go program in another language? Is that what you are saying? Honestly the no script push has always seemed a bit unfriendly and hostile to me. Not everyone who makes the statement. I believe many people who like sweet potatoes don't understand why others don't. It's called personality. Script is a personality issue also... and CF should be personality friendly.

06 February 2009 16:17 cet  

Tjarko wrote....

So what you are saying is that every language out there should provide at least two ways of doing the same thing to please everyone?? Because that is what you ask of coldfusion... Why stay there and not change every language?

I understand your point of view, what i do not understand is the fact why you started Coldfusion in the first place, if you think scripting is the missing link..

06 February 2009 18:38 cet  

John Farrar wrote....

You are right, you don't understand. As people's 'style' matures (I am not thinking script is everyone's style) some prefer to code logic in script. In fact some prefer to NOT code logic in tags. If you are able to do it in tags and like it that would be a strength of ColdFusion. The same in reverse. Flex works the same way. You have a choice of script or tags. And if the author thinks that "Scripting is killing for the language." then he is implying the only distinctive value of CF is tags. I beg to differ. :)

06 February 2009 20:41 cet  

jax wrote....

Come on Tjakkie! Brian has a point. And it's a darn good point too. I'm afraid your vision has gotten cloudy over time ;-)
To clarify things, let me give you an example:

A tag based language NEQ a simple to understand language.

versus

A tag based language != a simple to understand language.

Now, which one makes more sense to you??

;-)

11 February 2009 11:19 cet  

Michael van Leest wrote.... (site)

I think it's a good thing for Coldfusion to have more scripting capabilities. I understand your point of view Tjarko (and I feel the same about it), but this will open up Coldfusion to a broader developer world. People who are writing AS or JS can now also write server side code in Coldfusion (not that it's a good thing, but that's a different story!).

Adobe is letting people from different programming backgrounds program the way they prefer. That's a good thing, but for readability it can mess up the work flow. Project teams will need to make decisions about if they're going to do certain stuff in scripting, tags or a combo. No biggy as long as you and your team/client or whatever make clear what they want/need...

Another point is performance. I wouldn't be surprised if scripting would be faster then tag based. So if code will run faster in scripting, I understand your concern that cf will be moved over to a more scripting language which we don't ever want to happen! So if performance would be a factor, the product team needs to look into the performance of the tag based engine...

just my 2 cents...

11 February 2009 14:21 cet  

jax wrote....

>I wouldn't be surprised if scripting would be faster then tag based.

I doubt that. In the end all CF source code gets compiled into the same class files, so this shouldn't make a difference, except maybe on initial compilation.

But seriously.. everyone should embrace the scripting syntax. This syntax is what the world in one form or another uses and what we are progressing from. Getting a good grasp of it will make you a better equipped programmer in the end.

11 February 2009 16:50 cet  

jax wrote....

Seems to me you're more likely to be the red-headed stepchild of the web development world, 'anon'..

07 July 2009 12:37 cet  

Leave your comment

Your name


Your url/website/link/email....


Some room for your reaction is placed here..



The answer to the ultimate question is?? (42 ;-))




URL en mail addresses are translated for you... life sometimes is that simple!!