Helpful Information
 
 
Category: ColdFusion Development
ATTN Experienced (coldfusion) web developers

I know this forum is partial to PHP, but I wanted to know if anyone would be kind enough to share some thoughts on coldfusion vs PHP or vs anything, really. I've read some nice things about CF, but then again they came from CFM sites, so I'd rather hear comments from regular developers. thanks.

I've had pretty extensive experience with both, actually.

Thusfar, and despite CF's claims to the contrary, I've found that CFML consistantly takes noticeably more coding to achieve the same results as PHP, especially in complex applications, though the same issue applies to even trivial one-page scripts.

CFML also uses what I consider to be counter-intuitive operators; for instance, CFML uses IS NOT in place of PHP's !=; while language substitutes such as AND instead of && are also available in PHP, CFML uses these to the exclusion of more commonly used methods.

CFML encapsulates its code within tags, as the original purpose of the language was to allow non-technical designers the chance to use their basic HTML skills in a programmatic setting. Thus, CFML has:


<cfoutput> text #var# text </cfoutput>


instead of :


echo "text".$var."text";


as in PHP.

I find that the tag system can be cumbersome, esp. as most tags need end tags, which just adds to the amount of code you need. Also, by having the language tag-based, it makes it near impossible to separate functionality from layout/content. Such a separation is much easier to facilitate in PHP.

CFML starts arrays at the number 1, instead of 0, which just screams "this is a language for designers, not programmers", much like the operators.

I think its nice that Macromedia (MM) is trying to bind CFML to Java. However, much the same functionality is available via PHP.

The key difference between PHP and CFML in my opinion is the impact it has on your overall skillset.

PHP is essentially a web-specific descendant of C. If you've studied and used PHP, and it is the only programming language you've had experience with, PHP's syntax at least prepares you for using C/C++ and/or Java, due to various similarities between the languages. Also, in that same sense, Perl and Python are at least readable to you - if not even immediately available to you for use - if you've had experience with PHP. If sometime in your career there is a need for you to make a switch to one of the aforementioned languages, you stand a much, much better chance of picking up on key concepts of programming in those languages - from objects, functions, arrays, database interaction - because of PHP's similarity to other C-like languages.

ColdFusion is related to nothing, and is based on no prior programming language - and therefore cannot prepare you for working in other languages. There are no other programming languages that are similar in syntax to CFML. If your boss asks you to work with Java, or if you decide to make a career change and learn Perl, or C, you are going to have a much more difficult time, if CFML is the only "programming" language you know.

thanks. I doubted Coldfusion REALLY has advantages over PHP/ASP/Java in the long run. Although, I have to say, I've seen more websites use CFM than those of Perl, ASP, or even JSP.

More sites using CFML than ASP? Really? MS-related/owned websites have some 15-20% of all internet traffic, and they're using 100% ASP. JSP maybe - actually, fwiw, over the years I've seen many sites that used JSP move over to PHP or ASP. I don't think JSP works very well (I've always found it to be a royal pain in the arse, not to mention a bit unreliable, slow, buggy...etc; not that I'm a big fan of ASP, either ...) :D

Perl is a tough one... a lot of sites that use Perl have pages that end in .html, which basically masks their Perl usage. Hmmm... maybe its time to check Netcraft.

Regarding Perl, is it safe to say that most dynamic pages that end in .html are Perl driven? Consider this page: http://www.timeanddate.com/worldclock/city.html?n=159

They aren't necessarily using perl, you can set your webserver to parse any file extension using whatever (perl, php, etc).

On my server I setup .html files to be parsed as .php files. All I added was a line to an .htaccess file.

As for Cold Fusion, I looked into it several years ago and gave it the big thumbs down. For starters it generally runs on Windoze web servers. That alone is enough for me. But I also noticed that busy sites running CF were always painfully slow, and suffered a lot of downtime.

I'm hoping it will just slowly go away

Originally posted by thedude
They aren't necessarily using perl, you can set your webserver to parse any file extension using whatever (perl, php, etc).

On my server I setup .html files to be parsed as .php files. All I added was a line to an .htaccess file.

As for Cold Fusion, I looked into it several years ago and gave it the big thumbs down. For starters it generally runs on Windoze web servers. That alone is enough for me. But I also noticed that busy sites running CF were always painfully slow, and suffered a lot of downtime.

I'm hoping it will just slowly go away

What version CFML were you using?

CF / MX runs on Unix, Linux, or Windows equally as well; has a respectably fast load time; and its debugging messages are actually pretty good... those are essentially the only 3 things I like about working w/ CFML.

Otherwise, I'm w/ you- big thumbs down, hoping it will just go away. :D

I don't remember what version, it was about 5 years ago. I knew it worked on several platforms, but the majority of hosts at the time only offered it on Windoze.

The biggest flaw I saw at the time was the number of sites I saw that were having problems with it. Especially when they got busy.

I do a lot of web coding with coldfusion. I'm definitely not a designer, btw :) I'm not going to argue about syntax because that's purely a matter of taste, however a lot of the other common complainants about coldfusion are no longer valid with 6/MX. Performance is (a lot, lot) better, no more ODBC means everything comes and goes from your DB a lot faster too. In my opinion coldfusion's biggest weakness is that it is neither open source nor well supported by macromedia. If either of those two points where true, if it was open source or macromedia backed it to the hilt like MS does with ASP, i think you'd see coldfusion running in a lot more places - it really does have a lot going for it with regards to rapid application development.

Would you guys think creating a Cold Fusion board would be a good idea?

Originally posted by Jcaputo
Would you guys think creating a Cold Fusion board would be a good idea?

Believe it or not, as much as I prefer PHP over CFML, I wouldn't mind seeing a CF/MX board on Devshed. I have to code CFML for work, and as Macromedia's documentation on the language is just terrible, having an online resource to hit a community up for questions would rock.

Macromedia has a CFML forum, but the type of users on there can be a little basic... DS seems to attract more advanced/experienced programmers.

You got my vote.

Originally posted by cfgeek
I do a lot of web coding with coldfusion. I'm definitely not a designer, btw :) I'm not going to argue about syntax because that's purely a matter of taste, however a lot of the other common complainants about coldfusion are no longer valid with 6/MX. Performance is (a lot, lot) better, no more ODBC means everything comes and goes from your DB a lot faster too. In my opinion coldfusion's biggest weakness is that it is neither open source nor well supported by macromedia. If either of those two points where true, if it was open source or macromedia backed it to the hilt like MS does with ASP, i think you'd see coldfusion running in a lot more places - it really does have a lot going for it with regards to rapid application development.

cfgeek - I didn't mean to offend you (or anyone else) in any way w/ my comment that CFML is a language for designers, not programmers. To clarify, what I think I was trying to get at with my comment was the history of the language - the original purpose of CFML was to provide a lightweight, easy to use scripting language for web developers/designers whose only coding experience was HTML. Hence why CFML is a tag-based language... sorry if I stepped on your toes. :(

I completely agree w/ you about MM's backing; CFML has been their red-headed step child ever since they bought Allaire; fwiw, MM used .jsp for their own website until just recently. The documentation for CFML is the pits - books, training materials... I haven't seen anything that approaches whats available for PHP or other web scripting languages.

Originally posted by drgroove
cfgeek - I didn't mean to offend you (or anyone else) in any way w/ my comment that CFML is a language for designers, not programmers. To clarify, what I think I was trying to get at with my comment was the history of the language - the original purpose of CFML was to provide a lightweight, easy to use scripting language for web developers/designers whose only coding experience was HTML. Hence why CFML is a tag-based language... sorry if I stepped on your toes. :(

You didn't! :) You're 100% correct.


Originally posted by drgroove
I completely agree w/ you about MM's backing; CFML has been their red-headed step child ever since they bought Allaire; fwiw, MM used .jsp for their own website until just recently. The documentation for CFML is the pits - books, training materials... I haven't seen anything that approaches whats available for PHP or other web scripting languages.

I always got the impression that CFMX was traditionally geared more as an intranet solution. This seemed to be reflected in many aspects of the product, including support and pricing. It's changing, though. I, for one, hope that CFMX doesn't just go away ;)

Originally posted by Jcaputo
Would you guys think creating a Cold Fusion board would be a good idea?

I'd like to see that. I have no delusions about it getting a lot of traffic, though. ;)

Originally posted by cfgeek
You didn't! :) You're 100% correct.



I always got the impression that CFMX was traditionally geared more as an intranet solution. This seemed to be reflected in many aspects of the product, including support and pricing. It's changing, though. I, for one, hope that CFMX doesn't just go away ;)

Interesting... we actually use PHP for our internet sites, and CFML for our intranet sites where I work. Never made that connection, though...

Hey! Check out the CFML forum! JCaputo doesn't waste any time, does he???

Originally posted by drgroove
I've had pretty extensive experience with both, actually.

Thusfar, and despite CF's claims to the contrary, I've found that CFML consistantly takes noticeably more coding to achieve the same results as PHP, especially in complex applications, though the same issue applies to even trivial one-page scripts. Well, I'm what I would consider to be an advanced CF developer, and I'd say that this statement is not correct. Maybe a coding challenge is in order?



Thus, CFML has:


<cfoutput> text #var# text </cfoutput>


instead of :


echo "text".$var."text";

This would be true...except that you don't need to wrap EVERY call to a CF variable or function in <cfoutput>, as you are trying to show. In reality, an entire CF template can be written with only one set of <cfoutput> tags, which would result in much less code than the similar PHP output that you have shown.

I appreciate PHP as a great language, but the reality is that CF is much easier to code in and requires much less code in the end. Snippets and functions can help, but the wonderful abstraction that CFML provides is very hard to beat.

all i can say, is i have a great extent of experiance using CFML and while it is maybe more simple, it is still as effective for many things as php imho. Coldfusion is definatly a language for designers, its simple, user friendly, and easy to understand, but not nearly as dynamic as php. in the long run id rather use php but cfml is not a bad alternative (i recently coded a LARGE web based inventory management system using cfml with a backend of oracle 9i for a fortune 500 company that exports to excel, is reportable, searchable, and updateable with a minimal amount of code. it works fairly well and they are happy, the php code may have been a bit more consolidated and compacted but not to any large extent.) coldfusion also does not need to be wrapped by tags for everything it does on every line. 2 tags on one page and an if statement and u got yourself a nice search for a table in a database. also as for the comment of windowz based systems running cfml, pure lack of knowledge. we are currently running CFML on a sun enterprise 10000 w/ an iplanet webserver as well as other smaller sun boxes such as a sun 3000 w/ apache. it is unix/linux friendly. anyway just my thoughts.

blah well there we go, no need for me to post this reply to drgroove's stupid comment about CF using <CFOUTPUT> #var# </CFOUTPUT> as opposed to php's <? echo $var ?>
but there is one flaw in your argument kiteless, nesting <CFOUTPUT>'s causes problems, but even with that in mind it's still far shorter than php's echo for everything method

as for drgroove ignoring that post, - opinions are like arseholes, everyone has one, and some people are their opinion, drgroove, you fit that perfectly

php/CF features, the only benefit i can see with php is its image functionality, but then using CF with something like director would compensate for that, there are also methods inside Java and C++ for creating images, and since CF unlike php has the ability to utilise Java and C++ to further extend its abilities, i really dont see php as anything other than the popular kid that failed all his tests at school.

Originally posted by firest0rm
all i can say, is i have a great extent of experiance using CFML and while it is maybe more simple, it is still as effective for many things as php imho. Coldfusion is definatly a language for designers, its simple, user friendly, and easy to understand, but not nearly as dynamic as php. Well I don't want to get into a big argument here, but I have no idea what you mean by CF not being "nearly as dynamic". I've been using CF for over 5 years and as far as I know, you can make virtually any CF variable name, or variable assignment, dynamic. Do you have an example of what you are trying to say?

Originally posted by herakles
but there is one flaw in your argument kiteless, nesting <CFOUTPUT>'s causes problems, but even with that in mind it's still far shorter than php's echo for everything method you shouldn't ever need to nest CFOUTPUTs, except when outputting a query and using the GROUP attribute, when you have to nest CFOUTPUTs.

And yes, it is very easy to use something like the Java Image API classes from CF to create thumbnails and manipulate images.

ttfn,

Brian










privacy (GDPR)