Home » Programming

Why developers are dumping PHP for ColdFusion

By Prashant Sharma 7 September 2008 29 Comments

coldfusionIt’s costly,it isn’t ‘open source’ but still it’s becoming a handy replacement of PHP(and .NET) for plenty of developers worldwide.And there are a number of reasons why PHP guys are preferring ColdFusion nowadays.

BTW,ColdFusion is a web application development language,governed by Adobe(primarily developed by Allairs,which were acquired by Macromedia in 2001 and further,Macromedia got acquired by Adobe in 2005).

Right now,the trends are very much in favour of PHP.It has already captured a big chunk of web development arena(consuming .NET market) due to its “Free” and “Crowd fueled” nature.But still,the ColdFusion community is steadily growing stronger.

These reasons may not convince every PHP addict to shift over Coldfusion but will convince the PHP programmers enough reasons to give this ‘alternative’ a try(if they haven’t tried CF already).

So,here are the reasons for justifying the title of this write-up…

—————————————————————-

A beginner’s delight

ColdFusion(CF) is much simpler and cleaner(in terms of coding) and resembles HTML to some extent.Hence,even an HTML guy(with some OOP concept brief-up) can grab CF a lot easier than PHP or .NET.

ColdFusion’s grammar leads to fewer and more understandable lines of code,which is an ideal situation for a beginner in the field of programming.

—————————————————————-

Less complex

ColdFusion tries to hide complexities.You probably have a specific tool for handling administrative details which saves you time, avoid mistakes, and have much less details to review and adjust.

Here’s how a sample database query written in PHP :

<?
mysql_connect(localhost,username,password);
mysql_select_db($database);
$result = mysql_query(“select * from counter”);
?>

Now,the same query in CF looks like this…

<cfquery name=”Company” datasource=”yourDB”>
select from VendorID
</cfquery>

This clearly depicts the difference in complexity between CF & PHP.Also,it requires fewer lines of code than PHP, .NET or JSP to perform a similar function with ColdFusion

—————————————————————-

Smart error handling & debugging

It lets programmers create their own error handlers where extra care is required so that your application fails(if there is no other option) gracefully. With ColdFusion, one can customize error messages for a particular situation or event and can provide a certain level of detail to users and a different level to maintainers/programmers.

—————————————————————-

Integration with Macromedia Products

If you are already using Dreamweaver for webpage designing,then you will find it good to do the scripting in ColdFusion, as you get the benefits that integration between these two adobe services gives you.

You can insert ColdFusion code into Dreamweaver files quickly without any hassle and you can also use its built-in editor to modify the code.ColdFusion also integrates superbly with Adobe’s flagship product,Flash.

—————————————————————-

Cross-Platform compatibility

ColdFusion has proven its platform compatibility with hardly any exceptions on its part.ColdFusion MX offers better integration with J2EE compliance,offers broader XML support and much more.

—————————————————————-

Long time PHP developers may defend PHP with numerous justifications(which is also true on their part coz PHP is undoubtedly a prime option when it comes to developing web applications) but the above listed reasons fall on CF’s side,for sure…

____________________________________________________________________________

Other popular posts on TechPluto…

Update 1: If you want to know what’s latest with Facebook, the biggest social network on web today, check it out here. Also check out the best of Twitter apps.

Update 2: There’s one brilliant piece of analysis done by us on “Is ‘Gogle’ the Most Misspelled Word On Internet?“. You must take a look at it !

29 Comments »

  • Rick said:

    On Nov 1 the last reason PHP’ers have for not using Coldfusion will disappear when Railo an open source Coldfusion will debut as part of the JBoss project.

  • Gerald Guido said:

    Let me fix that for you:

    On Nov 1 *Both reasons* PHP’ers have for not using Coldfusion will disappear when Railo an open source Coldfusion will debut as part of the JBoss project.

  • ed said:

    Railo is great is it free and is basically free coldfusion (it is a cfml interpreter). The new version of coldfusion will let developers integrate with flex so that is where php starts to loose out

  • zodiaclove said:

    hi
    I do not agree with what you wrote really….
    please explain further a bit more for me ;D

    cheers

  • Php Xml Reader said:

    Good site I “Stumbledupon” it today and gave it a stumble for you.. looking forward to seeing what else you have..later

  • prashant said:

    Every PHP lover has full rights to say what you just said…and i also agree that PHP is really fast and easy to code but CF fraternity also has its bunch of reasons otherwise CF would have been discontinued by Adobe by now…
    And again…i am speaking facts…and i am quite RIGHT

  • Architect said:

    LOL, "fan boi" is the best way to describe the author of this article.

  • eturino said:

    for starters, the learning curve with CF is NOT as fast as in:
    - Python, Ruby, even Java: OO languages, so you can actually reuse much of what you already know about OO theory.
    - PHP: both OO or procedural programming. Common and quite standard 'thinking way', always the same.
    - any well-documented language. If there is a bug, i have to be able to know about it, and it has to be fixed asap. With CF you'll find out that many errors are not actually yours, but CF bugs. You have to learn where the weak spots are to avoid them. And forget about community knowledge. The little documentation there is about CF tags use and real behaviour comes from other users, but with a community so small its far from enough.

    Plus, what CF does without your knowledge is amazing. For example: if you don't prevent it (and its not as simple as you may think) it generates tons of whitespaces and new lines, enough to increment your html weight in like 40-50%. Even more if you pretend to use components (the CF Object Oriented approach).

    The overhead you get if you use one directive instead of another is huge – even when they're supposed to be equivalent – and worst of all, it is not documented at all. Nowhere. You have to play with it, test around, and you'll discover what CF custom tags really cost you.

    If you want to develop something a bit more complex than a simple personal webpage with hardcoded queries, you'll find out that you're alone in a scary undocumented world. Forget about choosing the right framework for you: there is none. Forget anything you know about MVC. If you try to implement your own MVC framework/strategy you'll find out that, in fact, you have to do it all. No help around.

    Of course, as a view oriented tag script language semi-evolved into something serious, the view development is easy. Kind of. If you compare it with strict java, C, or other non-view-oriented language. Its not faster than PHP, JSP, etc. Of course im talking about development speed.
    But, in any serious development, html printing is not the heavy part. And what you suffer there is hard enough for me to avoid CF.

    Debugging: The Coldfusion debugger before CF8 didn't support breakpoints and that kind of debugging at all. You only get a display with some info (by far not all you need). Even CF8's one is far from what you get with Java or even PHP's Zend Debugger. The error handling isn't better in any way that what you get with PHP or any other web programming language.

    Easy: Your example with CFQUERY has a weak point: you have to configure the datasource access in the evil ColdFusion Administrator in order to connect. Try to remember those ODBC access you have to configure when you worked with ASP. With PHP you can configure it or not, you have lots and lots of strategies and helpers, you can use PDO, etc. Ok, PHP lacks of Hibernate or something as powerful as that, but thats between PHP and Java (or Python, etc). CF is still in the 90s, in another league.

    Integration with Macromedia Products: Please. only one (2 if you count CFEclipse, a poorly mantained and buggy eclipse plugin) editor. And Dreamweaver is far from an efficient IDE. Is oriented to designers much more than to developers. As coldfusion is, by the way.

    Cross-Platform compatibility: is this supposed to be an advantage? PHP is not cross platform? or Java? or Python? Come on. If it wasn't cross-platform, it would be a complete joke. And, by the way: haven't you get that kind moment when you realized that for any unknown reason that script doesn't work the same way in those 2 servers? It's because it's not truly platform independent. Many languages are not, but at least you can find out where are the weak spots. With Coldfusion you're alone. If you want to avoid any surprises, dont forget: development, pre-production and production enviroments have to be the same SO with the same kernel and the same JVM. Don't say i didn't warn you.

    If you want fast develoment, well documented languages, as less bad surprises as you can get, great IDEs, frameworks and helpers, etc:

    AVOID COLDFUSION

    Disclaimer: everything im saying here are based on real situations with Coldfusion in my company. Good luck.

  • prashant said:

    I appreciate(and feel astounded) that you nearly wrote a post sized comment(or even bigger).And i really feel that you might have suffered quite a bit due to loop-holes that CF has(i agree).I can but just don't have enough time to write such long comments to address every point you made(a fresh post will be better).But let me end this discussion by copy-pasting few lines of my post again

    "Long time PHP developers may defend PHP with numerous justifications(which is also true on their part coz PHP is undoubtedly a prime option when it comes to developing web applications) but the above listed reasons fall on CF’s side,for sure…"

  • eturino said:

    It would be a really interesting. Im not actually such a PHP fan but – as i first wrote – a ColdFusion victim :)
    Any healthy discussion about this is more than welcome.

  • prashant said:

    Oh really ! but there are plenty of other things which i am crazy about….and CF is certainly not one of them… !
    Although PHP is largely popular compared to CF,i am speaking logical facts here..

  • eturino said:

    As a CF 'victim', let me just say: you're wrong. Period.
    ColdFusion is a complete pain, full of non-documented bugs, and CF development is at least 30-40% slower than PHP development. Id rather develop with ASP 3.0 and VBScript.
    Maybe later I'll post some real life examples with coldfusion development 'lifestyle', to answer the 'logical facts'.

  • Architect said:

    Ha! Healthy discussion about CF? eturino you serious?

    The author of this dribble clearly has no demonstrated knowledge of the concepts that you covered in your comment. Hence, there will be no rebuttal, as one requires sufficient development experience in OO or procedural programming to articulate one. That is why I didn't go to the trouble, and just stared trolling.

    "I can but just don't have enough time to write such long comments to address every point you made(a fresh post will be better)". I rest my case.

  • prashant said:

    OMG !
    How did u you know that i've no prior knowledge of basic OOP concepts like inheritance,polymorphism,loops etc when it's not at all a 'rocket science'(quite easy) to learn…I envy your smartness(lolz)
    Talking serious,you are quite right in saying that i don't have years of coding experience…..and i think,i don't even need to have it coz i'm not a coder(my source of bread & butter is different)
    Just like you don't need(can't guarantee but i just hope so) to be a 'telecom expert' to realize that WiMAX will replace Wi-Fi quite soon,i don't need to be a 'hardcore coder' to realise the advantages that CF offers over PHP and other prog. languanges

    But ending this stuff,i would say it again that PHP is winner of the two at the moment.

  • Raymond Camden said:

    eturino:
    re: learning curve: Obviously some people learn some things better, but you can't tell me that for a non-developer, CF would be harder than Java! If a person knows HTML, they will have a much easier time picking up CF than Java.

    re: bugs. So – are you saying that if you find a bug in PHP, it will get fixed immediately? That's news to me. Also, the CF community is certainly not small, nor is the documentation lacking. You can get close to 2K pages of documentation, for free, from Adobe, covering everything from basic reference material to development guides.

    re: whitespace – CF has long provided very simple ways to reduce whitespace. I've yet to find someone who isn't on a 14.4 model who is really impacted by it.

    re: custom tags 'cost' – Every language above machine code has a performance penalty. CF custom tags can slow things down if they are improperly used. Just like bad PHP code can slow down a server. I've yet to see a language that can prevent a person from writing poor code.

    re: MVC – You obviously know nothing about the _multiple_ available MVC frameworks available for CF.

    re: DB access. I have no idea what you mean by an 'evil' CF admin. That' s just plain silly and not useful to the discussion. Configuring db info in the CF Admin isn't any different from configuring it in XML for something like Hibernate. Your code should not have connection information embedded in it since it is configuration information and not business logic.

    re: Dreamweaver/CFE. Dreamweaver is much improved since the old days. Have you even looked at CS4? If not, you have no idea what you are talking about. Also, Adobe has announced Bolt, an Eclipse based editor that will be released next year. So you have will have a new IDE, debugger, etc, for CF.

    re: Cross platform – I agree with you that any modern language is cross platform, but the rest of your argument doesn't make sense. It sounds like you are saying that you will run into trouble if you move from one machine to another and they aren't similar. That's true for anything. What if you went to a version hosting an earlier version of PHP? Or .Net? Its a basic rule that you should ensure the machines in your cluster share the same setup.

  • prashant said:

    I think,Raymond(below) addressed your issues quite clearly.

  • eturino said:

    RE: re: learning curve: Ok, I see your point. Obviously I was talking about programmers, people who is going to learn a language and already know the programming and algorithmic theory. I agree, coldfusion seems to be designed to front-end designers who need to code a bit. Maybe that's a reason why not a single developer I know likes coldfusion, we're not the target.

    RE: re: bugs. I'm saying that find a bug in PHP is easier, you have many more tools, and fix them is also easier. PHP community cannot be compared to CF one. Size matters. Huge amounts of info, many sources, etc. Those things matter. Eiffel also has its community, but i wouldn't use it for a critical development. And i like Eiffel, something I cannot say about CF.
    By the way, i would be horrified if the really small and far from accurate CF documentation had any cost. Don't sell it to me saying "its free". Compare it with any serious language, please.

    RE: re: whitespace – not so simple, and not so effective. For starters, its an issue that shouldn't exist. And now you know someone. Largely used website needs any kilobyte. Again, size matters.

    RE: re: custom tags 'cost' – I've yet to see a language with those issues with supposedly equal functionalities. I'm not (only) saying that custom tags cost a lot, but that they are supposed to be the same, and so huge performance penalty is not documented and ignored. I'm not saying anything about bad uses, or poor algorithms. I'm comparing functionalities. Of course in Java reflection is slower. So in many other languages. But it's documented, and if you use it, you know it. To get penalties "for free", not because i have a poor algorithm, but because i use a standard functionality.

    RE: re: MVC – You're right, i know almost nothing about them. I've read some stuff about some of them, but i wasn't pleased at all. Again, compare it with the number, potential and size of PHP, Java, or any other serious language.

    RE: re: DB access. I don't like CF admin. But that wasn't my point. I was saying that if you compare that php code snippet with the <cfquery> one, compare it right. I'd never use a php code like that, the db config has to be separated, connections opened and closed in one specific way, in a specific manager class, etc. But dont tell me that <cfquery> is easier because you only need the query, and in php you have to connect to database and prepare the config. We both know it's not true.

    RE: re: Dreamweaver. Yes, i've seen CS4. Again, if you're a coder, there are many weaknesses. Im looking forward to try that eclipse based IDE (I'll follow it's development, thanks a lot xD), because CFE sucks a bit (i only use it in order to use the standard Eclipse functionalities, and it's extremely buggy). Hope it's ok, really. If it is even quasi-stable I'll use it. But, of course, debugger, auto-complete, I hope inmediate warnings while coding… yep… welcome to (at least) 5 years ago :)

    Re: re: Cross platform. My point is: don't sell that CF is cross platform to me. All serious web oriented language is, so it's not an advantage per se. And yes, there are many more environment related issues with CF than with PHP or Java, but it's a secondary point. The main one is: its a minimum, shared with the other languages, so it is not an advantage.

  • Raymond Camden said:

    re: Learning: Not everyone who does web dev has a degree in Comp Sci. I'm sure the same applies to PHP folks as well. I know plenty of developers who use CF. But, it's pointless to argue who we know. ;) For me, it doesn't matter how OO a language is. For me, it matters how practical a language is. Just because a designer can use it doesn't make it worthless to developers. And shoot, nowadays, we all where many hats.

    re: Size. Yes, PHP community is larger. It doesn't mean the CF community is nothing. More than 500K developers use CF. I'd call that something.

    re: Books: Without backing up your statements, I don't think what you are saying is very fair. I've yet to find one technical book w/o mistakes. It is impossible and I say this as the author of 10 technical books. You try your best, but mistakes happen. Adobe hosts LiveDocs, which are web enabled versions, of all their docs. It lets you post comments when you find mistakes. I am a CF expert, and I can tell you that the docs are very well done. Not perfect of course, but certainly not as riddled with mistakes as you claim. Also – 2000 pages of docs is really small? Seriously?

    re: whitespace – Not so simple? So you've tested the whitespace suppression? Sorry, but I don't believe you. The server setting version is very effective, and the <cfsetting> tag version is 100% effective.

    re: tags. Please back up your 'huge performance costs' with numbers.

    re: MVC – So yo don't like what you see. Ok. No point in arguing that. But you can't say there arent multiple MVC frameworks available for CF. Not as many as Java, certainly. But again – they exist – whether you like them or not.

    re: DB: So the fact that I don't have to worry about a DB connection manager isn't a good thing in CF? Even if you had to define connection props in CFML, cfquery and cfoutput make it very easy to get, and display, database information. As for the CF Admin, if you are going to say 'evil' CF Admin, be prepared to be called out on it.

    re: Dreamweaver: I think we need to agree to disagree on this. I assume PHP has an IDE w/ autocomplete? Bolt, the new IDE will.

    re: Cross platform. Agreed. We can drop that.

  • eturino said:

    Actually I want to make a final comment.
    I think coldfusion was a valid option a while ago. It painfully and slowly died and now, when the competitors are miles ahead, Adobe seems to be making an effort to impulse it. Good luck. I mean it. It seems that I will suffer CF more, so any development will be more than welcome.
    I also think its much more oriented to designers who needs to code some dynamic content than other languages. Pretty much like the original PHP target, when it was called Personal Home Page.
    Nowadays I wouldn't use it to develop a serious/large website or web application. Many reasons, not only what i've already commented. Community, IDEs, environments, frameworks, help, documentation, availability… the list is just huge. Even for non-programmers beginners, I would recommend other languages and platforms.

    To defend it, you cannot point out both the features of the commercial ColdFusion 8 and the free Railo (Railo has several editions, not all of them free xD, really CF style).
    Well, i'll try some of these stuff.

    BTW, even in the Railo webpage it clearly says one of the most frustrating weakness about CF: documentation or "CF will do whatever it likes":
    &lt;quote&gt;
    In ColdFusion CFC's are searched, THOUGH UNDOCUMMENTED, inside the customtag directory as well. In addition they are searched recursively in the sub directories as well. Railo does not support that. There are several reasons for that:

    * It's undocumented
    * It's irritating
    * is slower than absolute addressing
    &lt;/quote&gt;

  • eturino said:

    re: I assume PHP has an IDE w/ autocomplete?
    Yes. Many. For years now. My favourite is Zend Studio (many folks I know doesn't like the new Studio for Eclipse, i do), but there are free plugins for eclipse with that feature and much more.
    I hope Bolt is as good as you say. As I'll be using CF for at least a year more, it would be great for me. CFEclipse is so buggy it hurts, and Dreamweaver is not an effective IDE for me.

    Use a custom tag instead of a function => more than 10x slower.
    One of the biggest performance boost we had in our last workshop was changing a custom tag for include_once to a function. It was amazing. We had 3 days of intense emergency workshop to improve the performance of the website, mainly because of the CFCs overhead in the new architecture (partially solved with CF8), and that one was one of the best moves. In 3 days of really intense work, we cut down 40% the time per script, without any architectural changes: only playing around with CFML features, supposed to be the same. That kind of crap in a serious language, when it's not documented and you have to believe in small independent studies and perform your own tests to get shocked about how it really works… that's something I can complain about.

    As for the rest I think my last comment covers it up. ColdFusion seems to be designed for web designers who needs to code a bit, for web pages instead of web apps or large web sites. It's ok, there are many languages designed that way. I usually don't like them, as I find many leaks that cancel its advantages out.
    I'm sure you can develop a simple web page really fast with CF. Even a small website. I'm also sure it's not the best option out there, and its downsides in scalability and others outrank its advantages

  • Raymond Camden said:

    I like the Railo guys, they are great, but they are wrong in this regards:

    http://livedocs.adobe.com/coldfusion/8/htmldocs/b...

    This plainly shows where CFCs are searched for.

    As for serious web sites… there are plenty of large, enterprise level web sites using CF. I can whip out a list – and I'm sure you could for PHP. So let's just agree that folks are building enterprise level apps in both. If you insist, I will provide a list. Oh shoot, I'll do it anyway (http://www.adobe.com/products/coldfusion/customer...You should also note that the US government is a _very_ large user of CF. I would assume you would agree that the government is an Enterprise-level customer. To quote the link above: "ColdFusion is in use at 75 of the Fortune 100 companies."

    The number of developers is growing. The sales is growing. This to you is death? Wow.

  • Raymond Camden said:

    Sorry, an even better doc url:

    http://livedocs.adobe.com/coldfusion/8/htmldocs/b...

    I may accept our disagreements on what the best language is, but I'm sorry. I cannot except your wholesale knocking of the documentation.

  • eturino said:

    Of course you can. I can give you one: mine! :) A dozen countries, in the top 10 in every one of them, etc.
    I'm not saying "i've seen CF and I don't like it", I'm saying we use it at work and I still wouldn't recommend it.

    By the way, try the documentation for previous versions. And before you can say "CF don't do that, because it is documented otherwise", try it. We've seen many non-documented behaviours, even when the documentation says precisely that CF doesn't do that. Or try to change the JVM in your server. Some months ago we discovered a hidden bug in our code that the same server with another jre ignored. Same java version, different build.

    Large companies are really slow to change its systems. CF was an option (a valid one) several years ago. With CF 5 or so. Later, it was still better to adjust your CF code to upgrade (even with the license costs) than to migrate everything in another language. Now, we're paying that years ago we decided to wait. Now it seems to cost too much, so I think we're stuck with CF for at least 2009. But not a single developer in my company likes CF. We disagree on to which other language/platform we should migrate, but nobody prefers CF.

    I'm sure, US goverment pays for more CF projects than Java or .Net ones. Yep. Really sure. And new ones, of course. Come on, we've all seen goverment still paying for web developments with CGIs.
    Tell me large WEB companies use it. Tell me Facebook is migrating to CF, or Twitter, or even google. I'm not saying they prefer PHP (Google doesn't develop in php), but none of them uses CF. In fact, I think in web terms we're one of the biggest websites using CF. And we don't like it :)

  • Architect said:

    well done eturino, well structured response that should own all the fanbois.

  • prashant said:

    Hey Architect….You actually seem to be more of a PHP Fanboi btw….Anywayz,the above comments from a CF Expert are more than enough to justify the points being explained…

  • Matt Burgess said:

    Just as a correction, the document above incorrectly lists code that is not required at all to make a query. The mysql connection string is ALWAYS put in a config file, and does not need to be done to make the query. This is like suggesting you need to reconfigure the DSN for each query.

    $result = mysql_query(”select * from counter”);

    This is a more accurate code sample. And it's no more complex than the CF version.

  • prashant said:

    thanx for ur suggestion…

  • Dani said:

    Raymond and Eturino, thanks so much for this discussion.
    I’ve read somewhere that if you are a CF developer, you’d better learn another language. I’ve got to this discussion trying to understand why. I work with CF and so far the types of projects I’ve been involved with I haven’t felt I needed another one. I work with intranets for small (50 to 100 users is small?) organizations.
    I’ve tried to learn PHP many times, some of my clients had a PHP hosting when they contacted me. So far, none of them had any problem switching to CF hosting.
    Until now :) .
    Raymond, is there any recommendation you could give me, being you and I CF developers (you with much more experience than I) to learn PHP in order to use it as an extra tool?
    The one thing it really bothers me about PHP in the integration with HTML (compared to CF). Is there any good book, something like “PHP for ColdFusion developers”?
    Thank you guys!

    dani at thiez dot com.

  • Christopher Walker said:

    Ray you’ll never win against guys like eturino. Because they are so set in the idea that actually paying for something (CF) is against some developer secret creedo. They will find any reason to support why open source is superior to a commercial product. I work with one of these types. Everytime he argues we should dump ColdFusion and go to PHP I direct the CFO and CEO to Facebook, the slowest, clunky social networking site on the web. Sure its pretty compared to mySpace, but I can’t be convinced that Facebook’s latency is entirely due to bandwidth. (Perhaps mySpace is precompiled cfm?)

    But here is the biggie. In Ray Camden’s own site, Sean Corfield offers a script library where developers can run PHP code within ColdFusion pages. http://scripting.riaforge.org/

    Thats my 2 cents worth.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

Get Adobe Flash playerPlugin by wpburn.com wordpress themes