SitePoint Sponsor

User Tag List

Results 1 to 16 of 16
  1. #1
    Non-Member
    Join Date
    Aug 2007
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What is ColdFusion?

    What is ColdFusion? is ColdFusion better than PHP, what's the difference including pros + cons?

  2. #2
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Has google not helped you out on this?
    No, I REALLY dislike having to use Joomla.

  3. #3
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ColdFusion is a Macromedia product (now Adobe) ... it's a scripting language that now (in the latest version) runs over Java.

    CF main problem is you need a special server to run it, not a lot of hosts provide it with their normal plans.

    Personally I'd take PHP over it any day for the simple fact almost every hosting company in world supports it (even though many of them support the wrong version)

  4. #4
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Give it a try, why not? Development version is free.

    http://www.adobe.com/go/trycoldfusion
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  5. #5
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by TicTac View Post
    is ColdFusion better than PHP?
    is Windows better than Linux? are the Sawx better than the Yankees? do you prefer sugar and cream, or do you like your coffee black?

    i'll tell you one thing, coldfusion is ~way~ easier to learn, and to write
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  6. #6
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The difference between CF and PHP is exactly $1,299.

  7. #7
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by stereofrog View Post
    The difference between CF and PHP is exactly $1,299.
    There are ColdFusion hosting plans in roughly price range of PHP plans.

    It's true though, cost is definitively a point for PHP.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  8. #8
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    i'll tell you one thing, coldfusion is ~way~ easier to learn, and to write
    I can't agree. Having to type <cfoutput>#var#</cfoutput> every time I need something...ermm...output, isn't as easy as <?php echo $var ?>
    No, I REALLY dislike having to use Joomla.

  9. #9
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    that's a trivial example, innit

    do you happen to know what the GROUP= parameter on the CFOUTPUT tag does?

    let's see the php code for this --
    Code:
    <cfquery name=GetEmployees datasource="#dsn#">
    select division, department, employeename
    from employees
    order by division, department, employeename
    </cfquery>
    
    <cfoutput query='GetEmployees' group='division'>
    <h2>#division#</h2>
    <cfoutput group='department'>
    <h3>#department#</h3>
    <cfoutput>#employeename#</cfoutput>
    </cfoutput>
    </cfoutput>
    sample output:
    Code:
    Head Office
      Marketing
        Joe Blowhard
        Tom Promises
      Personnel
        Mary Timestamp
    Factory
      Supervisors
        Fred Taskmaster
        Todd Kamalfechuk
      Assembly
        Biff Worker
        Fred Slave 
    important:be sure to show all your code to set up the connection, run the query, and process the sorted output from the query
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  10. #10
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by r937 View Post
    that's a trivial example, innit
    Not when you're just starting to learn.

    And no, I was not aware of such a parameter. I put the stopper on my ColdFusion intake once I started learning PHP. I thought it was easier to learn.

    CF has too many <cftagthis> and <cftagthat> for me. I like my coffee with cream and sugar, by the way.
    No, I REALLY dislike having to use Joomla.

  11. #11
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    fine, personal preferences are what i was getting at

    i'd still like to see your php code for the grouped output, though

    can't tell you how many times i've seen forum threads on this site by php programmers who don't know how to do it and expect some sort of miraculous solution from the SQL itself...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  12. #12
    derrrp
    Join Date
    Aug 2006
    Location
    earth
    Posts
    923
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Someone with a more expert knowledge of PHP will have to.

    If it's not possible (to do it so simply, I should say), then kudos to CF for having that neat trick.
    No, I REALLY dislike having to use Joomla.

  13. #13
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    oh, the php equivalent is certainly possible, it's just ugly and cluttered as hell

    and i haven't even mentioned the CF functions yet

    how about ValueList() for starters
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  14. #14
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Not that messy, more code yes but not ugly or cluttered.

    PHP Code:
    <?php

    function display ($data$formats$d 0) {
        
        
    $r '';

        foreach (
    $data as $key => $value) {
        
            if (
    is_array($value)) {
            
                
    $r .= sprintf($formats[$d], $key);
                
    $r .= display($value$formats$d 1);
                
            } else {
            
                
    $r .= sprintf($formats[$d], $value);
                
            }
            
        }
        
        return 
    $r;

    }
      
    $db mysql_connect('localhost''user''pass');
          
    mysql_select_db('test'$db);
          
    $sql 'SELECT * FROM employees ORDER BY division, department, employeename';
    $res mysql_query($sql$db);

    while (
    $row mysql_fetch_assoc($res)) {
        
        list (
    $id$division$department$name) = array_values($row);
        
    $list[$division][$department][] = $name;
        
    }

    mysql_free_result($res);

    $formats = array('<h2>%s</h2>''<h3>%s</h3>''<p>%s</p>');
    print 
    display($list$formats);
    Output:
    HTML Code:
    <h2>Factory</h2>
        <h3>Assembly</h3>
            <p>Biff Worker</p>
            <p>Fred Slave</p>
        <h3>Supervisors</h3>
            <p>Fred Taskmaster</p>
            <p>Todd Kamalfechuk</p>
    <h2>Head Office</h2>
        <h3>Marketing</h3>
            <p>Joe Blowhard</p>
            <p>Tome Promises</p>
        <h3>Personnel</h3>
            <p>Mary Timestamp</p>
    Mysql did give me a different order then yours however.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  15. #15
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,273
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by logic_earth View Post
    Mysql did give me a different order then yours however.
    LOL, point taken!
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  16. #16
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Although being much more familiar with PHP than ColdFusion, it would be quickly apparent to me what that ColdFusion example code does, while that PHP would require a few minutes and some head scratching.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •