views:

4873

answers:

20
+17  Q: 

ColdFusion vs PHP

Can anyone share with me (without fervent evangelism, please) any comparative experiences you might have with regard to ColdFusion and PHP in developing internal enterprise browser-based applications?

Specifically (but not limited to):

1: Do the rapid-development characteristics of ColdFusion compensate for any performance issues resulting from the additional overhead?

2: Is either particularly suited to individual or team development?

3: Is rapidly developing an application in ColdFusion and then porting it to PHP to improve performance a proposition that only a madman or venture capitalist would consider?

A: 

I am afraid I cant give you an answer to your question, but I think you should have a look at django. Its based on Python and it focuses on rapid development.

I second this. The correct answer to choosing between X and Y where neither X nor Y is equal to Django, is Django.
pdc
A: 

Well, it seems you've picked Ugly and Uglier as your possible solutions, and I'd have to say that Coldfusion is Uglier.

PHP is just much more powerful, flexible, and efficient. There's also a lot more community support for PHP. Evangelism (either for or against) aside, PHP has the capability to write well-designed, efficient software. I can't say the same for CF. CF is dying, PHP only gets better with each version.

Porting really is something only a madman would consider.

EDIT: Apparently CF is again in active development. Although the project is not dying, I stand by my statement that PHP is a more flexible, more efficient solution.

Lucas Oman
I'm not really sure CF *is* dying. I read a magazine called Web Designer Magazine (original, eh?) - and they are writing increasing amounts of CF tutorials. Whether they've hired a CF guru or not I don't know, but it does strike me that Adobe might be working on it after it's Macromedia takeover.
Ross
CF is not dying. Adobe has continued to work on it - CF 8 is the current release - and is actively integrating it with their other technologies like Flex.
Dave DuPlantis
That surprises me; thanks for the info! Even if it's living, I stand by my answer, though. I guess we'll have to see where they go with the project.
Lucas Oman
It is not a highly-visible language, and I don't know that Adobe can change that. You can definitely do very cool things with it - Flex and Ajax, for starters - but it will never be a Java or, well, a PHP. :)
Dave DuPlantis
ColdFusion 9 (Centaur) is in active development, and CF10 is in the planning stages.
Al Everett
"CF is again in active development" also is incorrect - active development has not stopped since it began in 1996 or so. Also, the community support - there is a big CF community as well. If you don't know, don't speak.
Nathan Strutz
Alive and well in the U.S. gov - pay isn't bad either.
Nick
@Nick I know we all have to make a living, but the fact that the gov is using it doesn't say anything about its quality or current relevance.
Lucas Oman
"the fact that the gov is using it doesn't say anything about its quality or current relevance" - Well the fact that other languages are more popular doesn't mean they are "powerful, flexible, and efficient". Popular languages get that way with the right combination of factors. "Uglier"? The code I write is beautiful!
Adrian Lynch
+1  A: 

I can respond to #3 by saying that I would think it wiser to choose a language now rather than wasting time porting an application later - only to find it doesn't have XYZ compatibility.

From what I've seen (I've seen tutorials/articles on ColdFusion code but never actually used it) CF is of a HTML-style syntax which could allow more people who would not necessarily be programmers (e.g. frontend/HTML people) to jump in and start helping out.

Bearing in mind that I am a PHP user (although not as envagelistic as others) I would suggest building in PHP first. There are drawbacks if you decide to switch to CF later on (syntax & structure is different (does CF have header/class files?)) because while CF has many great features built in (out-of-the-box CAPTCHAs for example) it's different with PHP. I'd say that you could port CF to PHP, but not the other way around.

Please note that I am making fairly wide assumptions on CF here based on what I have seen. As I said, I've read a few tutorials on the subject and the code seems to be mainly inline in the HTML. This needs backing up :-) However I stick by my first point - choose a language first, and then stick to it. Do your research now.

Ross
A: 

If nothing else, PHP avoids the need to pay for Coldfusion Server.

ceejayoz
ColdFusion isn't the only option. I run many sites on Railo which is free. Also, what about dev costs? I use both languages and CF pisses on PHP from a great height every time!
Adrian Lynch
+1  A: 

I don't have any experience comparing PHP and ColdFusion, but I can speak from a ColdFusion perspective.

It can certainly be used to develop enterprise applications, and it can be used for both individual and group development - I did both at my last job and am doing individual development at my current job. Of course, you will need to use proper project management to develop quality applications, as you would using any language.

I don't think it would be worthwhile to move the app to PHP if you were developing it in CF. Porting any application from one language to another is a ton of work; doing an application twice is probably not the right direction to choose.

I think one approach you might take is to consider where expertise would be. Do you know people who know either language well? Does anyone on the team know either language? How much time do you have to learn?

If you have a reasonable amount of experience with one and not the other, that's the language I'd suggest. If you have experience with neither, but you have access to quality resources for one, pick that one. Otherwise, I expect it's six of one and a half dozen of the other.

Dave DuPlantis
+4  A: 

Having worked in both, I think the honest answer is that you can get most of what you want accomplished in either language. When I worked in a ColdFusion shop, I coded in ColdFusion, now that I work in a PHP shop, I code in PHP (someday, maybe I'll work in a Python shop...:-)

One obvious difference that one of the other posters mentioned is that PHP is free and open source while ColdFusion is not. Also, in terms of your own professional development, I think that PHP is a more widely-useful skill. PHP has a large community to draw from, along with lots of useful functionality for dealing with web requests, XML, databases, object oriented design, etc etc...On the other hand, if you or someone on your team speaks Java, newer versions of ColdFusion server are also Java app servers, and you can integrate calls to Java libraries into your CF code.

All things being equal, though, I think PHP is a much better choice.

jmans
+5  A: 

As someone who has supported both in production, PHP is the clear choice.

  1. PHP's documentation and user community are much stronger than CF's.
  2. There are over 50 frameworks for PHP development, and a variety of existing libraries to leverage such as PEAR.
  3. It's free and open source.
  4. PHP's C-like syntax makes it more attractive to anyone who hopes to move on to other languages down the road or has existing experience with C-like language syntax.
Cory House
re #2: ColdFusion has been object oriented since the release of CFMX in June of 2002. Those features have been vetted through three full point releases. CF9 is expected to improve the OO as well.Re #4: Railo wich is a FOSS CFML app server is now part of the jBoss.org community.
anopres
PHP 5 "Just added" OO support? Wasn't that about 5 years ago?Of course, ColdFusion added robust object support about 5 years ago too, so it's not a real comparison point.
Adam N
Points taken - edited accordingly.
Cory House
1. Debatable. Adobe/MM/Allaire have an entire team of Technical Writers who are constantly cranking out high quality documentation. While PHP has a greater number of developers, CF makes up by having a higher caliber.2. CF has tons of frameworks, but you only need a couple 'good' ones.
Adrocknaphobia
+1 CF's documentation is terrifying
Brendan Long
+1  A: 

I've worked with both, formally extensively with Cold Fusion, and more recently with PHP.

Cold Fusion whilst superficially easier does have a tendency to deteriorate into a mess as it (certainly used to) assume you were going to simply embed the code directly into the HTML with no reference to MVC or similar design patterns that good usage of PHP, leveraging the [framework or your choice or even just template system], can give you.

The solution to that is to adopt Fusebox (http://www.fusebox.org/) I've not used it for a while and I don't know how it's adapted to AJAX, but if you must use Cold Fusion it's a well thought out logical framework. There is a PHP version too, but I've never heard of anyone using it.

Generally, given the choice, I'd fairly strongly go for PHP, primarily because of the wealth of community support there is out there. Most importantly though choose a good template system (I recommend Tiny But Strong as it's a joy to work with) or Application Framework. However if you must use Cold Fusion, given appropriate development standards, it is a perfectly valid choice and shouldn't impact in any way what you can deliver. In terms of development speed myself I think there is little to choose between them and certainly not enough to make this a determining issue. Developing in CF and porting to PHP though is defiantly the way of madness :-)

Cruachan
Starting with ColdFusion MX, it is being tailored towards separation of the presentation and the logic. Most of the ColdFusion tags in HTML should be limited the bare minimum of what is needed.
Rob
+4  A: 

I've done development with both ColdFusion and PHP and I can say this - they both have their ups and downs.

Right off the bat, PHP gets a couple points because it is free where as the ColdFusion server license costs some money. However, the ColdFusion server also has a lot of maintenance and development tools built in so you could make a case for the $1300 making up for that. Also, it is worth noting that BlueDragon is in competition with Adobe here and they also offer a ColdFusion server option.

Personally I think that performance is a non-issue between the two due to the fact that since ColdFusion MX came out, CFML files get complied into Java classes. Also, I have been getting the impression that the newer versions of ColdFusion are being steered in the direction of web application development as opposed to websites with some dynamic content.

Programmaticly, I don't think there are any major deal breakers between ColdFusion and PHP. The ColdFusion tags get some getting used to, but you can also use CFScript, a C-like syntax version of ColdFusion tags, if you prefer that syntax for most operations. In terms of development, I personally think that ColdFusion 8 has a bit more in terms of options for rapid-development than PHP considering the fact that it supports .NET and Java out of the box where as PHP might require some work to integrate with those technologies. However, if you are not going to be using any of that stuff then why pay for the server license?

At the end of the day I think you are going to need to sit down and look at what you are going to be developing and then look to see what features the two languages offer. If you are doing something where the ColdFusion feature set is going to be useful for rapid-development then go the ColdFusion route; if you aren't going to be using any of those, then go the route of PHP.

So the bottom line short summary of the two languages:

  • ColdFusion - Server license isn't free, not as popular as other languages, tight integration with other Adobe products, integration with other web technologies out of the box (e.g. Ajax, .NET), allows for rapid development of web applications.
  • PHP - Free, popular, third-party libraries offer integration with most popular web technologies, may not interface with .NET libraries you already have, popular for development of dynamic content web sites and web applications.
Rob
+3  A: 

I have been a coldfusion developer for a few years now and before that used PHP. I have to say that before Coldfusion MX 7 it would have been a wiser choice to go with PHP, but since the advent of CFC's and the OOP standard that Coldfusion now employs it's a great platform to build on. And since CF8 has brought radical performance changes into the mix it is in my never to be humble opinion a better platform to build on. If you can get past the initial cost of buying the server.

Jeremy Reagan
+10  A: 

I've programmed in both PHP and ColdFusion. A number of years ago we were starting to build an enterprise web app that would have a global impact for our organization (a Fortune 100 company). For various reasons we finally settled on ColdFusion (the cost of the CF license was a non-issue for us and never was a consideration in our decision).

We are going on five years building, maintaining, upgrading, etc. this app and I can now say unequivocally that going with CF was the best decision we ever made. It has been an absolute joy to work with. We have had no performance problems (in my experience any of the major platforms - .net, jsp, php, cf, etc. - will be able to handle anything you throw at it; the major performance bottleneck will usually be the database).

Adobe releases an updated version of CF every year to year and a half and it just keeps getting better.

CF is especially a good choice if you are going to work with any of the other Adobe technologies like Flex, Flash and AIR. Since they are all created by the same company there are a lot of things built in to CF that make communicating with the other technologies a snap.

irrational
+54  A: 

Wow, there is really a lot of misleading or plain wrong information here in the comments about ColdFusion. I know next to nothing about PHP, so I'm not going to comment on any of it. I've been using ColdFusion for about 12 years and I think I can shed some light on it for you.

First, ColdFusion is not dead or dying and never has been. Allaire certainly kept it rolling since it was their flagship product, Macromedia constantly had it under development, and Adobe is about to release version 9 with 10 and 11 already in the pipeline, although 11 is little better than a somewhat credible rumor at this point.

The absolute best thing about ColdFusion is that it lets you develop the way you want. If you're just doing a simple brochure website and you need a little dynamic spice added to a few pages, you can just put them in there. No need to build out an entire application scaffolding when all you need is a pair of functions.

On the other hand, developing very large, object-oriented, framework driven applications is also possible. There are large multi-year projects running with as many as 40 developers at the Social Security Administration, the Food and Drug Administration, The Kennedy Center, the State Department, etc. (I live near DC, if you couldn't tell.) ColdFusion has had object-oriented features since version 6 when it was changed from a stand-alone application written in c++ to a Java library that runs on many J2EE servers.

If you need to manage your team's coding practices, there are many mature/stable frameworks available to help you out. I saw that Fusebox was mentioned earlier, and that is one of the strongest ones for MVC. There are others, though, and even Fusebox is not stuck at version 3 which seems to be the last time most people looked at it. shameless plug warning--> I even do some work on a thing called MXUnit, which is a unit testing framework for CF.

Many if not most CF developers now use Eclipse as their primary coding tool because of all the other Eclipse plugins that platform brings with it. The main FOSS plugin for ColdFusion is called CFEclipse. If you have more of a designer approach to developing, Dreamweaver is for you but you have to pony up the cash for that. Adobe has also shown us some love with a set of line debugging tools for Eclipse as well as connectors to the server that let you inspect your objects remotely as well as manipulate files and databases. Rumor has it that Adobe is thinking about developing an über IDE using Eclipse along the lines of what IBM has done.

If you need to do development on a shoestring, the development version of ColdFusion is free. So are some of the other CFML servers such as the SmithProject, Railo and BlueDragon on J2EE. Shared hosting is very reasonable, although not as widespread as some other technologies. It's best to use somebody that is aware of ColdFusion like HostMySite.com if you are going to go that route. If you're hosting yourself, save the cost of an OS and run it on Linux with MySQL or PostgreSQL.

Use of CFScript gives you a more Javascript-like syntax if you don't care for the tag brackets, although with version 8, all features are not supported in script. You can write wrappers for some of them if you want. Version 9 is supposed to support a Javascript-like syntax for all object coding.

One of the things about ColdFusion often overlooked is that it is probably the best server-side technology for creating the service layer for applications written in Flex. Even the Adobe people fail to mention that very often, probably out of fear that the CF stigma might somehow attach itself to Flex. That's unfortunate becase CF supports the amf protocol out of the box as well as allowing you to pass typed objects between it and Flex/flash.

The developer community for ColdFusion is also alive and well. If fact, many people think that the ColdFusion bloggers were a big reason that Adobe purchased Macromedia. Certainly, social tools tend to wax and wane as people come and go and technologies change. While the ColdFusion forums used to be a big gathering place, it seems like a lot more activity has gravitated to blogs and aggregators. And now, even a little Stack Overflow ;).

Personally, I wouldn't bother with the code/port process. That's just too much unnecessary work for a new project.

Lastly, I don't understand the comments about performance, really. ColdFusion compiles down to Java classes and runs on a J2EE server. It's going to be about as fast as anything else that runs with that sort of architecture with a few exceptions. Each release seems to make significant gains in performance as well. It's possible to bring any server to its knees with unscalable coding procedures, but there is nothing that says you have to code that way.

I guess the real trick is to make sure you get credible information about the platforms in order to make an informed decision. That can be hard to do sometimes in a community driven site since it's easy to spout off (like I'm doing) and hard to post references for everything you say (like I'm not doing).

Good Luck!

anopres
I second that vote.
Jeremy Reagan
Thanks for taking the time to write that up.
Tomalak
Nice post - you should mention coldspring http://www.coldspringframework.org/ and it would be perfect
Nick
"I know next to nothing about PHP" which is indeed your problem. I came from PHP to CF and if you had any idea what sort of pain I'm going though then you might reconsider your viewpoints of CF. CF is *not* a real programming language - it is a template language that compiles into byte code. CFScript is a joke; atleast in version 8; with all of its inconsistencies. Please. Just work in PHP for a bit. You will not regret it. It will take some adjustment... but damn dude - if you give it a hard enough look you will never want to go back to CF.
nlaq
Gee Nelson, you've convinced me. I'm going to use PHP from now on. I'm really looking forward to setting up amf and object serialization to flash.
anopres
+13  A: 

It seems to me the comparison is not all together fair. CFML (coldfusion markup language) and php might be better for straight language comparison. As for a comparison to Adobe's Coldfusion i think its more inline with the Zend Platform then you could break down feature for feature in terms of optimization, load testing, code cashing, etc..

I'm not going to go all evangelical one way or another with those too except to say i think that is the most fair comparison and neither is free, and both come with a lot features to help you deploy on an "enterprise level". I would start there with those comparisons.

Alternatively as mentioned above their are several other engines available: New Atlanta's Bluedragon , Railo, and the smith project. The former two offer enterprise as well as free community solutions. So cost should not be an issue in comparison.

With regard to open-source or free software both OpenBlueDragon and Railo on JBoss (comming soon) are viable sold options for an open source engine, while on the software side riaforge.org is a good place to look at some projects in various states of release.

Your question seemed concerned more about the performance qualities, and as a poster above mentioned a lot of it is on the quality of your coding. CFML in any of the three big engines (bluedragon, railo, coldfusion) compiles down to java. So on the front end you will get bit of a performance hit as the jvm warms up, then it starts screaming. if your code is written will, in the long haul under a load java has been proven to hold consistent with performance much longer than code complied into "C" like ruby or php or perl, but i'm not an expert and you can take all kindof of benchmarks depending on your situation. If you worried about performance i would seriously consider java for a large load. I think their might be quality ports for php to java but i haven't looked too deep. Otherwise you would want something along the Zend line for optimizing for performance (which comes at additional costs)

I mention heavy on the CFML side because with the exception of the last poster the comments seem rather unbalanced, and i think it important to see all the options out there and know that both have viable enterprise and/or open-source low to no cost solutions to be had.

As another poster mentioned, when the right comparisons are actually made, both are really well suited to meet any need, and in the end i think i might come down to person/productive preference of you and your development team.

ethyreal
Zend as a framework is free. You can also use the PDT stuff for eclipse == free
mugafuga
+6  A: 

I've programmed professionally in both PHP and ColdFusion for about the last 10-12 years. From what I can see, the cost/benefit breaks down somewhere along these lines:

ColdFusion is easier and faster to write in. The syntax is more intuitive (for most things), and you don't spend as much time building the "scaffolding" for your project (i.e. Database layer objects, etc...) because the language has so much built in. 5 years ago, I would have said that the ColdFusion syntax was much more coherent than the PHP syntax, but there have been too many fingers in the pie now, and ColdFusion has gotten almost as muddled as PHP. ColdFusion tends to outperform PHP at runtime on simple pages, but gets bogged down on complex pages. ColdFusion has a lot of built in debugging and profiling features that I sorely miss when I move to PHP.

PHP is free, and has tons of community support. The problem with that is that sometimes there are so many options on how to do PHP, it can be easy to get stuck in "Analysis Paralysis", and you spend so much time in Architecture that it's hard to push yourself to settled down and start banging away at code. Also, there are a ton of libraries available for PHP, few of which are compatible with eachother. The PEAR DB library doesn't work very neatly with Smarty, which doesn't really work at all with CakePHP, and so forth. These frameworks so radically alter the way you work in PHP that they may as well be their own languages. ColdFusion has a smaller proliferation of frameworks, and the authors tend to spend a good ammount of time making sure they work with eachother. While PHP is free, the debugging and profiling support are almost the same cost as the ColdFusion server.

Ultimately, given my choice, I'd probably go with ColdFusion. If you're worried about performance, check out Railo, which is an Open Source CFML engine (runs ColdFusion code) and was designed from the ground up to be super fast. In fact, it was originally designed to convert PHP code into ColdFusion code to speed it up...

Adam N
+3  A: 

Hi

I have been developing with CF for about 6 years now and I have done some PHP work in my spare time, though nothing at the enterprise level, so I am speaking from a CF background mainly.

If you come from any other (non-PHP/CF) background then 'out of the box' CF is faster than PHP as so much configuration etc is done for you. You don't have to get all tangled up in libraries and header files: in CF 90% of what you need to do is available right away. Obviously things even out when you use frameworks etc., but CF for a simple website is easy to setup. That is just my opinion having used PHP for some small personal websites. However, the CF licence costs money which is why I was using PHP in the first place!

The other big advantage is that, in a nutshell, CF sits on top and uses Java. This means if you have the jar file that does some specific job, you can drop that in, and use it through CF very, very easily. While this is not the normal course of action (as CF has handles most stuff natively), it does open up a huge community (the Java one) and allows you to leverage that technology. It's also very useful for when you have to integrate with a third party because since CF is built on Java, you are dealing with well-known industry standards.

I'm not saying that PHP can't do these things, I'm just drawing attention to the fact that the CF-Java relationship can be very useful, and very powerful.

Cheers, Ciarán

Ciaran Archer
+2  A: 

I was a hardcore php user 2 years ago, but since I switched to coldfusion, I haven't looked back. Before I thought cf was crappy because of the syntax it uses (html tags style) but there is so much more to it.

Anyway I'll take either over .net haha

jdsushi
"Anyway I'll take either over .net haha" - Amen and Halleluja!
BeMeCollective
+1  A: 

One part of the question that no one had answered is the porting to PHP part. Personally I don't see a huge difference in performance between the two platforms but if you needed to port somewhere I think java would be a much better choice. Coldfusion and java play well together so migration can be incremental and with the advent of coldspring can even use the same XML configs.

Nick
+1  A: 

Are apples better than pears?

Leaving aside the community issue, there is little to choose between CF and PHP.

However, as a dev manager who used to manage a CF team, I know it was extremely hard to find quality CF developers. There are way more PHP developers out there (I live and work in London, UK; it may be different elsewhere).

If I was starting a new system from scratch I would use, of the two, PHP for this reason alone.

Although CF vs PHP is a false dichotomy. There are other choices too.

DanSingerman
+2  A: 

I'm the lead developer for the CFML version (original) of Fusebox. It also has 2 different ports to PHP, not exactly sure how the other version got out there but there are 2 PHP ports. I never really cared for PHPs syntax so that puts a negative for me on PHP but I wouldn't judge the language soley on that because given time syntax is just that syntax and you get used to it, though I still struggle with JSPs (but that is an entirely different subject, right?). So let's get to your questions:

1: Sort of, I guess. I can't say I've really seen too much on the performance front with issues. I mean you have to understand how ColdFusion works or you could get yourself into trouble in an OO design but overall I've not see performance issues. As an example we have an enterprise CMS running on Fusebox 5.5 and run load test with 500 concurrent users and it doesn't break a sweat, response times are typically sub second. Putting performance aside since I think it is not really relevant, I think a strong developer can be productive in any languages they are strong in. I feel like a non developer will become more product more quickly with CFML, in particular ColdFusion. That's not to say PHP can not be RAD or picked up but I do feel the ramp-up time for CFML is ridiculously low.

2: I've never used PHP in a team situation. I have used CFML in team situations and it works well, it again has more to do with team dynamics and organization and having a strong framework helps with that. ColdFusion has some good strong frameworks, PHP does as well. Both languages suffer from many No CS background folks picking up the language, so you'll get that stigma on either side.

3: Madman, If one chooses to go the CFML route there are far better ways to optimize if needed than scrapping a system. I would be surprised if you find you have to optimize with either choice but if you went to CFML and needed to optimize you would probably find better reuse in moving parts of the back end to Java or Groovy not moving to PHP.

Overall I've used CF and Java in the Enterprise and PHP in personal development and I am confident either option works, but for Web based development I think you'll find CF backed by Java (if/when needed) is a pretty impressive development environment.

Couple of aditional things I'll throw out there:

  • Performance v RAD is something to think about if you look at Ruby and Ruby on Rails (customization also).
  • If price really bothers you there are, as others mentioned, there are alternative CFML engines (I happen to be on the OpenBD project). Quick note though you need a better understanding of JEE as both projects do not bend over backwards trying to hide the JEE complexities like ColdFusion does. I think ColdFusion's value proposition is still pretty strong in many organization so I would not discount the cost, consider exchange integration and some of the marvelous JMS integration.
  • The developer community is probably larger behind the firewall for ColdFusion than it is for PHP but PHP has a larger overall Developer community. I was pretty impressed to read the developer numbers for CFML were around 700k+ and growing hand over fist yearly. Third party research not funded by Adobe or initiated by Adobe.
  • If you put any stock in industry analysis Gartner had a, mostly, nice review of ColdFuion and recommended it as a technology to use in the enterprise. PHP was not reviewed. It did have skepticism on how it would be rated in 5 years but 5 years in technology is pretty long. Not sure who funded this research, I am not aware of it being Adobe but do not know for sure.
Adam Haskell
A: 

I'm a Coldfusion guy myself but if I had to learn 1 language, I'd pick PHP hands down. Google, Apple, no one uses CF seriously.

AnApprentice
I'm not sure if it's still maintained, but this list was always pointed at when someone mentioned no one important using CF. http://www.forta.com/cf/using/list.cfm?categ_id=31
Adrian Lynch