Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Coldfusion Vs. Php

Recommended Posts

This thread has already some years grown, though I wanted to give my opinion to it. I'm programming for more than 10 years now, started with PHP (privately) and four or five years ago came to CF (through work). And with the time I started to prefer CF over PHP due to it's in my eyes simpler syntax, better readability, more unified function base, better debugging information and some other little things. Non-the-less I'm still programming PHP privately, because there are several projects using PHP.

 

A lot of misinformation

Coldfusion Vs. Php

 

Many of these posts contain a great amount of incorrect information regarding Coldfusion.

 

In my experience, 90% of people who dislike Coldfusion have either no, or very little experience with it, and the experience they have is often 5+ years old.

 

I think Coldfusion gets a bad reputation because it is indeed so easy to learn, and because of this, theres a lot of bad code out there. However, comparing noob-level CF to more advanced PHP is certainly not a fair comparison. Coldfusion, written by competent developers, is both clean and highly modular.

 

Also, one thing people mention is that if you know C/C++, learning PHP is easier than CF. This statement shows the ignorance of most people regarding coldfusion. 90% of coldfusion can written in a C-style manner, called 'cfscript'.

 

I think there are certainly benefits to each. PHP is free, and more widely supported, and theres a lot of free stuff written in it. CF is backed by a larger company and can access any Java libraries at will.

 

Personally, I prefer Coldfusion. I like the language more (seems cleaner), and the rapid development factor makes a difference -- I can write half the code to do the same things in PHP. There are also a lot of built in, officially supported features that are very nice, including automatic PDF creation from HTML content (though, I'm sure many of the built-in features of CF have been created by someone for php).

 

As for high-level performance issues, I can't really comment, as I have no experience in web apps with huge amounts of traffic (hey, I'm not doin the sales, lol), but I've heard the rumors regarding CF's performance as well. I have also heard that CF8, the latest version greatly increased enterprise-level performance, and there are plenty of bigger sites out there running it.

 

It all comes down to whats right for you. If someones debating which to learn, I say learn both. Syntax is syntax, a good programmer can adapt to any situation.

 

 

-reply by absurdparadox

 


I totally agree with you! It seems most of the people praising PHP never tried ColdFusion. ColdFusion is definitely easy to learn and with <cfscript> there is no excuse for all the people here saying, PHP is easier to learn when you're already knowing a language like C++. Though I prefer the tag based syntax, because in my eyes it's easier to read. Want an example? Here you have:

 

PHP:

include 'dbconnection.php';$sql = 'SELECT firstName, '.       '       lastName, '.       '       birthday '.       'FROM users '.       'WHERE ID = '.int($userID);$userData = mysql_query($sql);while($row = mysql_fetch_assoc($userData)) {  var_dump($row);}

ColdFusion:

<cfquery name="userData" datasource="db">  SELECT firstName,         lastName,         birthday  FROM users  WHERE ID = <cfqueryparam cfsqltype="cf_sql_integer" value="#userID#"></cfquery><cfdump var="#userData#">

In this little example the code is already some lines smaller and the output is way better to read because of <cfdump>. At https://www.mollerus.net/tom/blog/2007/12/8_reasons_to_like_cfmls_syntax_over_phps.html there are some more advantages listed (even when I'm not agreeing with all of them).

 

Having worked extensively with both ColdFusion and PHP, I can say that there is less of a learning curve with ColdFusion. However, I'm trying to use PHP exclusively for several reasons:<div> </div><div>

It's an ACTUAL programming language. In other words, I can carry more over from knowing PHP than I can with ColdFusion, so if I ever need to code REAL web apps with Python/Django/Javascript, I can.

It is object oriented. There is nothing cleaner and neater than OO code. Have stock libraries for applications is excellent to stream line a site.

It's secure. Because of it's OO abilities, (namely bound parameters and results) SQL injection attacks are a thing of the past.

It's efficient. It doesn't take many resources to run and it's a breeze to install.

It's free. We don't have the money to update ColdFusion with every release.

Support is GREAT in PHP. Most of the code you need is written for you, anyway.

<div>Alright, I'm done. ColdFusion is easier to learn, but it's not very useful for anything other than writing ColdFusion code, making your business/corporation/department stuck in sticking with ColdFusion which ultimately will not be able to meet your demands as your business grows. What's more, so many huge sites use PHP and other FOSS. When was the last time you were on a ColdFusion-powered page, anyway?</div></div>

 


Obviously you didn't really try out the functionality of CF. ColdFusion is a programming language like PHP, just the syntax is different (if not using <cfscript>). Also ColdFusion has object orientation! There the classes are just called "components". But just like in PHP you can mix OO with procedural programming, it's up to you. Security is also not an advantage of PHP, because both are offering ways to avoid SQL injections or other hacking techniques. Therefore <cfqueryparam> is used in CF. CF is also easy to install and when using Railo it's also free. Adobe even offers scientific licenses now (as somebody already mentioned before), which are also free. And as long as CF is not used for commercial purposes you could always use the free developer edition.

One bigger downside of CF is the smaller community (especially in countries outside the States like in Germany where I live). Though there are also several good sources for help and code snippets out there.

As for the argument, that for growing businesses you can't meet the demands I have to say, that I merely saw the bigger companies having sites created with CF, while smaller ones (probably due to the price) are mostly using other techniques.

Also note, that PHP 6 is already in development for many years and still has to implement some things like full Unicode compliance, which CF already has and some suggestions like named parameters are simply refused by the developers (see http://de2.php.net/manual-lookup.php?pattern=%7Ederick%2Fmeeting-notes.html〈=de&scope=404quickref). Adobe on the other side is updating their product every one or two years with the downside, that you have to pay for upgrades. But of course you're not forced to always upgrade your server to the newest version.

 

Greetings from Germany

 

Sebastian

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.