We help IT Professionals succeed at work.

Coldfusion vs. PHP

Anthony Lucia
Anthony Lucia asked
I have been researching Coldfusion, and have found it appears to lag behind PHP in the market report below:


From my limited research, Coldfusion allows an easy coupling of HTML with database integration. to allow RAD

Does PHP perform the same function?

Watch Question

Distinguished Expert 2017
Php and mysql,
The difference coldfusion can only run on systems that have it installed, since php is open source it is widely adopted and installed.
There are many IDEs to help PHP development from netbeans, eclipse, zend studio, etc.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014
From this page http://w3techs.com/ :

Server-side Programming Languages

Most popular server-side programming languages
© W3Techs.com usage change since 1 March 2015

1.      PHP      82.0%      -0.1%
2.      ASP.NET      17.0%      
3.      Java      2.9%      +0.1%
4.      ColdFusion      0.7%      
5.      Ruby      0.6%      

percentages of sites
The stats above are likely accurate in popularity because PHP is free.   So, if you need to hire employees, you will find many more who know PHP.  But ColdFusion allows a faster development time, fewer lines of code, more intuitive coding (closer to standard HTML) and a shorter learning curve.
@gdemaria -  I agree with you. It also depends on what you trying to accomplish in your environment as well.

Yes, you will find more developers that know "PHP" than "CFML".  However, ColdFusion can really reduce the amount of code in most cases.

Here's an example that uses ZXing ("zebra crossing")  an open-source, multi-format 1D/2D barcode image processing library implemented in Java, with ports to other languages -  https://github.com/zxing/zxing.

ColdFusion snippet
<cfset paths = arrayNew(1)>
<cfset paths[1] = expandPath("core.jar")>
<cfset loader = createObject("component", "javaloader.JavaLoader").init(paths)>
<cfset BarcodeFormat = loader.create('com.google.zxing.BarcodeFormat')>
<cfset QRCodeWriter     = loader.create('com.google.zxing.qrcode.QRCodeWriter').init()>
<cfset MatrixToImageWriter = loader.create('com.google.zxing.client.j2se.MatrixToImageWriter')>
<cfset QRcode = QRCodeWriter.encode( "#baseURL##qrCodeGUID#" , BarcodeFormat.QR_CODE, form.optQRSize, form.optQRSize )>
<cfset image = ImageNew( MatrixToImageWriter.toBufferedImage( QRcode ) )>
<cfimage action="writeToBrowser" source="#image#" format="png">

Open in new window

What the snippet does
1 Create array to store directory path
2 Expand path to Zxing core jar file
3 Use the java loader utility so that the Application Service does not require a restart
4 – 6 Use java loader to create ZXing Objects to create the QR code
7 Encode the QR Code and specify the size
8 Buffer the image
9 Write image to browser
Most Valuable Expert 2011
Top Expert 2016
Laravel.  Google it.  PHP is the engine (WordPress, Joomla, Drupal, Facebook - all written in PHP).  Laravel is the Mercedes-Benz.
@Ray Paseur -  The  Laravel is nice. What PHP Framework would you recommend for use Windows Server, IIS, and PHP? The back-ends are SQL Server 2012 Enterprise.

I guess you could say that our environment is very holistic. We integrate everything from Natural/ADABAS, iSeries DB2 & PHP, ColdFusion, C# .NET, VB.NET, etc...

I do love using ColdFusion, although the Google search results are disheartening - "PHP" (10 billion hits), "CFML" (470K hits).
@Lajuan - I'd use Laravel in that environment too.  Although it installs very easily in a LAMP environment there are a number of tutorials out there that show how to make the config changes to make Laravel run on IIS.  There is a little bit of work up front but the beauty and simplicity of Laravel will make up for it when you start developing your app.

There's a bit of a learning curve with Laravel but the resources at http://www.laracasts.com are phenomenal to help you with almost any questions you have on the framework.
@Scott Madeira - Thanks.
Most Valuable Expert 2011
Top Expert 2016

Agree with Scott about LaraCasts - Jeffrey Way is  a good teacher.  Scotch.io is also a good resource.