Compared to PHP?

Discussion in 'Programming' started by Plutonic, Mar 2, 2012.

  1. #1
    How difficult is ColdFusion compared to PHP? In terms of what you can achieve with it, is it better or worse than PHP?

    I have to learn it for Uni and have no idea what I'm in for.
     
    Plutonic, Mar 2, 2012 IP
  2. jonnyewing

    jonnyewing Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    I've always found it easy to use, but I learned CFML long before I had to tackle PHP so it's hard to know what it would be like doing it the other way around.

    Some functions are incredibly simple and fast to use. In particular, being able to query a database by running a <cfquery> and then outputting the content using a <cfloop> is very intuitive and extremely simple - you just create a Coldfusion DSN in the Administrator and then all your database interactions are sorted. Equally, importing from XML is really easy using the XmlParse() function.
     
    jonnyewing, Mar 5, 2012 IP
  3. Co1dFusion

    Co1dFusion Peon

    Messages:
    33
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    They are very simmilar in what they can do, but the syntax are slightly different. PHP is much more commonly used so learn that if you want to.
     
    Co1dFusion, Mar 6, 2012 IP
  4. 137th Gebirg

    137th Gebirg Active Member

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    I agree with all that was said here, but one of the big plus arguments that businesses have in favor of PHP is that it's free, and bundle-apps like XAMPP seamlessly integrate PHP (and PERL) with an Apache web server and MySQL database server all-in-one. I found PHP pretty easy to learn, but like jonnyewing above, I learned ColdFusion first and I also worked heavily in PERL back in the 90's. PHP was a natural progression for me and, unlike PERL (which seemed to be nothing more than a SED- or AWK-script-style engine shoe-horned into the web world), PHP was natively designed to work with the web, just like ColdFusion. As far as ease of use for a beginner, however, I think ColdFusion works the best. And yes, CFQUERY and CFLOOP are fantastic, particularly now that newer versions of CF support nested query loops.
     
    137th Gebirg, Mar 6, 2012 IP
  5. GunnyTurd

    GunnyTurd Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I learned PHP last week, and then discovered ColdFusion. The differences are huge but the output to the end user is nearly the same.

    In my opinion, PHP is programming, and ColdFusion is a fancy form of HTML. Although it takes some logic to use ColdFusion, I think it requires a lot less work to code in. I Find it easier to use ColdFusion, but PHP is free, and it is hard when you are used to programming in C# and PHP to go to ColdFusion, which works completely different. I am so used to things like:

    <?php
    $string = "Hello, this is a test page";
    echo '
    <html>
    <head><title>HI</title></head><body>' . $string . '</body></html>';
    ?>
    PHP:
    But in ColdFusion you would do this:

    <cfset string = "Hello, this is a test page">
    <html>
    <head><title>HI</title></head><body><cfoutput>#string#</cfoutput></body></html>
    HTML:
    It is just a completely different way of doing it.

    *Honestly, I think ColdFusion is much easier and has more ease functions like nested query looping, while PHP gives you more control and is more like other programming languages.
     
    GunnyTurd, Mar 18, 2012 IP
  6. mark2048

    mark2048 Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #6
    It sometimes gets confusing when you mix CFML and HTML together. I like PHP better.
     
    mark2048, Mar 22, 2012 IP
  7. jonnyewing

    jonnyewing Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    mark2048 - You're entitled to your opinion and I expect lots of people share it, but is it not equally confusing mixing PHP and HTML? Or any scripting language and HTML?
     
    jonnyewing, Mar 23, 2012 IP
  8. 137th Gebirg

    137th Gebirg Active Member

    Messages:
    70
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #8
    ^^^ I can sort-of understand what mark2048 is saying in his post. CFML, like HTML, is a markup language at its core (hence the "ML" in "CFML") - not a programming language in the absolute truest sense of the word like PHP, Java, PERL and other coding environments, even though ColdFusion contains if-then-else and other programming language-like tags. It's far easier to interweave the CFML with HTML - in fact, it's really almost impossible not to mix the two together. In PHP, there is always a strong delineation between the HTML world and the PHP world, which always involves
    <?php ... ?>
    Code (markup):
    as the line of demarcation between the two.
     
    137th Gebirg, Mar 23, 2012 IP
  9. jonnyewing

    jonnyewing Member

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #9
    Actually the majority of CF developers tend to write code inside <cfscript></cfscript> tags, so it's much the same, really.

    Take a look at this latest post from leading CF blogger Ben Nadel and tell me this doesn't look like "real" scripting!
     
    jonnyewing, Mar 23, 2012 IP
  10. GunnyTurd

    GunnyTurd Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    It seems as though ColdFusion does everything PHP can do, but it does it more efficiently and securely. Like database queries (PHP needs mysql_fetch_array, etc. But ColdFusion just needs <cfoutput query="queryname">WHATEVERYOUWANNADOWITHTHEQUERYRESULTS</cfoutput>
     
    GunnyTurd, Mar 23, 2012 IP