I'm not worried about CF going anywhere. At least it has the benefit of a
single company with a huge marketing budget. I'd honestly be more worried
about PHP going somewhere than Coldfusion as PHP has no central
company/organization that "owns" it, therefore no single company which has a
real investment in it's longevity.
Well.. that's the eternal open vs. closed question, and one which we
won't solve today. I think we're just going to have to disagree on
this. I believe that a dedicated developer community working together
can create stable, useful and long-living software. I don't believe
that a marketing department is necessary if the code speaks for
itself. And I don't believe for one second that having one company
"own" a platform is a good thing. PHP isn't "owned", but do you think
Yahoo would let their programming language of choice go away? Nor
would any other of the many large corporations who rely on PHP every
day. So in effect a successful open-source product like PHP or even
Apache, is being looked after by an army of interested companies and
individuals. And, since no one entity "owns" it, it can not be killed
by one person or company, thus eliminating the single point of
failure. I know CF has a very vibrant user base and many large
corporations use it, but they would have NO say if Adobe decided to
kill it and take the copyright to their grave. But again, this is
just my opinion.
I gotta agree with Paul here. I don't think CF is going to die, but PHP
is here to stay as well. There are just a few things that I've gotten
used to in ColdFusion that PHP doesn't do, or that it's more difficult
(or takes more code) to do in PHP.
You say that you don't like CF because of the code? That's absolute
nonsense...I'm all for coding, I really enjoy it too, but WHY write an extra
ten lines (or more) of code when you don't have to? Do you rewrite your
Replace function every time you use it?
It's just personal preference. foreach($array as $key => $value){...}
just makes more sense to me. It's that simple.
I agree that it's a matter of opinion. But I've gotta say that I *LOVE*
being able to treat *any* arbitrary string of text as a list (read:
array). Let me give you an example:
<cfset TheList = ListRest(CGI.HTTP_REFERRER,"?")>
<cfloop index="i" from="1" to="#ListLen(TheList,"&")#">
<cfset ThisItem = ListGetAt(TheList,i,"&")>
<cfif ListFirst(ThisItem,"=") EQ "numPageID">
<cfset MyNumPageID = ListLast(ThisItem,"=")>
</cfif>
</cfloop>
This code allows me to treat one string of characters (the http_referrer
in this case) as three different arrays. I didn't have to create an
array out of any of it. The very powerful "List" functions allow me to
accomplish this, and CF handles the conversion to arrays eternally. This
is *not* to say that I can't create and manipulate arrays directly, and
that I *have to* use lists instead of arrays, that's just not true. I
can use the ArrayNew() or StructNew() functions to create arrays and
structures that I can easily reference and manipulate.
I guess when you can do that, it's just a different way of thinking
about strings and what you can do with them. If PHP can do this (work on
strings as if they were arrays), then I don't know how to do it, and I'd
love to see.
The other thing I find a pain in the rear to do in PHP is deal with
databases. Take for example this:
<?php
// connect to server
$HostName = "localhost";
$DBPassword = "";
$DBName = "someDBName";
// select the database
$dblink = mysql_pconnect($HostName, "root", $DBPassword);
$db_selected = mysql_select_db($DBName, $dblink);
if (!$db_selected) {
die ("Can\'t use ". $DBName . " : " . mysql_error());
}
// get site stats
$getSiteStats = "SELECT * FROM " . $tablename;
$thisResult = mysql_query($getSiteStats,$dblink);
$thisRow = mysql_fetch_assoc($thisResult);
?>
In ColdFusion All I have to do is this:
<CFQuery Name="MyQuery" DataSource="MyDSN">
SELECT *
FROM SomeTable
WHERE Some Column = 'somevalue'
</CFQuery>
In the PHP code I had to use mysql_fetch_assoc() to get the first row
into an associative array, in ColdFusion the above cfquery code
automattically returns a "Query Object" called MyQuery. I can
immediately loop over each of the rows in the query result set
referencing them like this:
<cfloop query="MyQuery">
<CFSet ThisColumnOneRowOneValue = MyQuery.Column1>
#ThisColumnOneRowOneValue#<br>
</cfloop>
Each time through this loop we'll be looking at the next row. If I want
to access a specific row I could say: MyQuery[rowNumber].ColumnName.
Using this syntax I can also loop over the query like this:
<cfloop index="i" from="1" to="#MyQuery.RowCount#">
<cfset ThisValue = MyQuery[i].ColumnName>
#ThisValue#<br>
</cfloop>
Other than that the SQL code between the two cfquery tags must be valid
for the sql engine you will be accessing, my code doesn't know or care
what sort of sql I'm accessing. no need to have special functions to use
different databases.
Anyway, I just find that simpler than the PHP way. Maybe it's just
because it's what I'm used to, but I think it's simpler.
Cheers,
Chris
Writing in tags is
great too, I just prefer the syntax. I prefer Ruby to PHP, but that
doesn't make PHP bad... I just like Ruby better. I don't like feeling
like my hand is being held, and for me CF does that. I was never very
advanced in CF so I never got into writing custom tags or any of that
stuff... so I could have a misconception there, but I'm just sayin'...
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/