Oh, and did you know you could do this
<cfscript>
s = "a,b,c,d,e,f,g,h,i,j,k";
z = s.split(","); // this line, here
for (i = 1; i LT 5; i=i+1) {
writeoutput ("hello " & z[i] & "<br>");
}
while (i LTE arrayLen(z)) {
writeoutput ("testing " & z[i] & "<br>");
i=i+1;
}
</cfscript>
Yes, that is Java in CFSCRIPT. Stuff ECMA. We have Java
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Behalf Of Joel Cass
Sent: Wednesday, 10 May 2006 5:28 PM
To: [email protected]
Subject: [cfaussie] Re: Whats so bad about the tag syntax?
"Three things right with Tag based code"
1. It cuts time for doing complex functions (checking mail, FTP etc)
2. It's easy to create structured code without having to inherit this and
public that
3. It doesn't mess up the look of the file (that much anyway)
I only use cfscript to improve the speed of things. Otherwise it just looks
too out of place and makes it too difficult to understand for newcomers. In
my regard, C++ or VB programmers shouldn't really have to look at CF code
anyway.
Did you know you could do this too:
<cfscript>
// for loop (as below)
for (i = 0; i LT 5; i=i+1) {
writeoutput ("hello " & i & "<br>");
}
// conditional loop
while (i LT 10) {
writeoutput ("testing " & i & "<br>");
i=i+1;
}
</cfscript>
The only gripe I have it that you have to use ampersands to join strings,
even though for the most part it looks like javascript..
My three cents (my balance is now at ten cents.. woohoo)
Joel
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED]
Behalf Of Dale Fraser
Sent: Wednesday, 10 May 2006 10:26 AM
To: [email protected]
Subject: [cfaussie] Re: Whats so bad about the tag syntax?
Two things wrong with Tag based code.
1. Other developers when they see ColdFusion code hate it and immediately
dismiss it as not a real language
2. You need to write about double the amount of code every time
<cfloop index="i" from="1" to="10">
</cfloop>
for (i=1; i<=10; i++) {
}
See the differences in the amount of characters typed in this simple
example.
Regards
Dale Fraser
________________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Patrick Branley
Sent: Wednesday, 10 May 2006 09:10 AM
To: [email protected]
Subject: [cfaussie] Whats so bad about the tag syntax ? was: where have all
the cf developers gone ?
I have to say i dont mind using the tag-based syntax for writing code. I
would argue rather than making CF script ECMA compliant they should make the
tag-based syntax XML valid! Who wants to write in the ugly Perl-like syntax
of Php ? And its not so much writing it as it is reading other people's code
who dont know how to comment correctly.
CF is not the only tag-based language out there. .NET has custom tags & java
has taglibs. They are a good way of writing simple logic as part of a
tag-based page.
What i think is missing from CF (and can someone confirm this is possible
with JRun / CF Enterprise ) is a way of writing java objects and deploying
them to the server on the fly just as you would write a CFC ? If so, then
its just a matter of providing some Java APIs to the existing CF
functions/tags in a java syntax (which would already exist id say, but just
arent documented)
If all of that was available then the workflow would be like this:
1. CFM pages with tag-based syntax for presenting HTML content.
2. POJO's for where you would currently use CFC's (but with the advantage of
them being instantly deployable, rather than code-complie-deploy)
Pat
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"cfaussie" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---