Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
HorsePunchKid said:Here's a little comparison, which is of course not terribly realistic. I think it gives you at least a general idea of how readable ColdFusion is, though. And that doesn't even touch on custom tags, which are a godsend that PHP is totally lacking.
I do realize that, but it is very typical of the sorts of lame programming I've seen in PHP applications to get around the fact that querying databases and dealing with result sets is an ugly process when it's embedded in markup. Again, I believe the example illustrates this idea, regardless of the layer you go through to access the database.doh said:
The SQL query itself is even more typical of the PHP I see (Gallery and osCommerce, for example), and it's exactly the kind of code you're "expected" to write (documentation and tutorials, in my experience). ColdFusion on the other hand, while still far from ideal in its handling of queries, at least lets you easily write queries in a natural fashion (that is, in the way that SQL queries are typically presented outside of any particular programming environment).doh said:and very evil SQL query written in a non-readable way
I do have well beyond a "very basic grasp" of PHP, and despite my experience and vim's courageous effort to make it legible with syntax highlighting, I still find it to be hideous. I would much rather work with the query as I formatted it in the ColdFusion example. I don't have to worry about quotes and concatenation and all that garbage that has nothing to do with SQL.doh said:fairly easy to read especially if you have even just a very basic grasp of PHP.
If it were me, I would have done a lot of things differently. Any experienced programmer has a bag of tricks to make their code more maintainable. I suggest that ColdFusion requires a much smaller bag of tricks to produce maintainable code, and is therefore much more conducive to rapidly producing smallish web-to-database applications.doh said:If it was me I would probably have used sprintf to format the query.
HorsePunchKid said:The SQL query itself is even more typical of the PHP I see (Gallery and osCommerce, for example), and it's exactly the kind of code you're "expected" to write (documentation and tutorials, in my experience).
SELECT
*
FROM
table
WHERE
a='a'
LIMIT 1