Rapid Development with ColdFusion and CFML

Rapid Development with ColdFusion and CFML

May 6th in Other by Matt Gifford

Experience the speed, versatility and sheer joy of developing your web applications in ColdFusion 8. All you need is some space on your PC, and 45 minutes.

PG

Author: Matt Gifford

I'm Matt Gifford AKA ColdFuMonkeh, a Senior ColdFusion Developer working in London, with over 8 years in web development and a passion for new technologies and languages. I'm here to help with any ColdFusion, jQuery and other web queries.

Overview

You may or may not have heard of ColdFusion or CFML (ColdFusion Markup Language), but pretty soon you're going to love it. Why waste time developing 80 lines of code in one language when you could do the same in ColdFusion in no more than five?

In this tutorial we will be aiming to accomplish the following:

  • We're going to download and install Adobe ColdFusion 8, and create a development server on your pc.
  • Learn the basics of ColdFusion tag coding, including queries and variable persistance.
  • We're going to download and install Railo Express, an open source CFML engine, as an alternative.

Download and install Adobe ColdFusion 8

Firstly, we need to download a copy of ColdFusion 8 from the following location: http://www.adobe.com/go/trycoldfusion. As will all Adobe downloads, you will need to login, or create an account if you don't aleady have one. Select the 'Developer Edition', and choose the application relevant to your operating system, in my case 'English|Windows|374.8MB'.

Download Adobe ColdFusion 8

Once the download has completed, run the install file and follow the next steps to complete your installation of ColdFusion 8!

Adobe ColdFusion 8 Splash Screen

Click next to proceed from the introduction screen, and accept the ColdFusion 8 License Agreement on the next.

Adobe ColdFusion 8 Splash Screen

On the install configuration screen, we want to install the developer's edition, so check the box and click the 'Next' button.

Adobe ColdFusion 8 Splash Screen

The server configuration screen displays three options for installation. For this tutorial we need the first option, 'Server configuration', which uses a self-contained server. Select this option and move to the next screen.

Adobe ColdFusion 8 Splash Screen

Here, we get to select subcomponents to be included in the installation. In this tutorial we don't require the '.NET Integration Services' or the 'Adobe LiveCycle Data Services ES' components, so don't choose those, only selecting the three remaining options. Click 'Next' to proceed.

Adobe ColdFusion 8 Splash Screen

By default, the installation directory is C:\ColdFusion8. Leave this as it is. If you do want to change the directory, please bear in mind that further comments in this tutorial will reference this installation path, so you may need to adapt the paths to suit your changes.

Adobe ColdFusion 8 Splash Screen

For web server configuration we are going to be using the 'Built-in web server', so select this option and click 'Next'.

Adobe ColdFusion 8 Splash Screen

Select a password for access to the ColdFusion administrator. Enter this twice, and click 'Next' to proceed.

Adobe ColdFusion 8 Splash Screen

Select 'Enable RDS' and enter a password. Click 'Next' to proceed.

Adobe ColdFusion 8 Splash Screen

You're almost there! The next screen displays the installation summary, and details of the ColdFusion configuration. Notice the port number (8500) underneath the 'Server Information' heading. ColdFusion will be running on this port number, so your ColdFusion server address will be 'http://localhost:8500/. Click the 'Install' button, and let the good times roll. The installer will now do it's thing and complete the setup for you.

Adobe ColdFusion 8 Splash Screen

During the installation, you will see various splash screens and messages highlighting some of the options and benefits available to you when using ColdFusion.

Adobe ColdFusion 8 Splash Screen

Once the installation is complete, you will be asked to log in to the Configuration Wizard, which will set up the administration interface for you. The address is http://index ost:8500/CFIDE/administrator/index.cfm, but by selecting the 'Launch the Configuration Wizard in the default browser' option, the address will automatically load for you.

Adobe ColdFusion 8 Splash Screen

Enter the Adminstrator Password you had defined in the earlier stages of the installation, and click the 'Login' button. That's it. You've successfully set up a ColdFusion development server.

Adobe ColdFusion 8 Splash Screen

You are now presented with the ColdFusion administrator interface. This allows you to control all aspects of your ColdFusion server, adding datasources, turning debug output on or off, managing session and application timeouts plus so much more. For now, we don't need to worry too much about anything in here, as it's set up for all we need in this tutorial.

ColdFusion Tags and Coding

Now that the ColdFusion server is installed, it's time for the typical 'Hello World' example, and to learn the basics of ColdFusion.

As mentioned previously in this tutorial, ColdFusion is a tag-based language, and one that should feel comfortable to anyone who's ever typed an HTML tag in their lifetime.
A major benefit, and one to remember if you cannot recall a tag name for a specific function, is that all ColdFusion tags start with the prefix 'CF'.

For example, to set a variable you would use the tag 'cfset'. To output data, you would use the tag 'cfoutput'. To dump a scope or any variable, you would use the tag 'cfdump'.
I bet you can't guess what tag you would use to run a query? If you guessed 'cfquery', you're 100% correct.

Create a new file called 'index.cfm', and save it within the webroot of your ColdFusion installation (in this case, C:\ColdFusion8\wwwroot).
Add the following code snippet to your .cfm page, save it again, and view the masterpiece in your browser (http://localhost:8500/index.cfm)

<cfset strHelloWorld = 'Hello World!' />
<cfoutput>#strHelloWorld#</cfoutput>

Perfect! You are on your way to becomming a CF guru. So, what did we do? We created a string variable 'strHelloWorld' using the cfset tag. To output the data, we used the cfoutput tags and surrounded the variable name with hash marks. This is us telling ColdFusion it is a dynamic variable. Remove the hash marks from either side of the 'strHelloWorld' text, and save and view the file again. See what I mean? Without the hash marks, the value will be rendered as a literal string.

Time for a query

Now let's try a query. Within the CF Adminstrator (http://localhost:8500/CFIDE/administrator/index.cfm) under the 'datasources' menu, you can see there are a few default databases created for you. Let's run a quick query on one of the databases.

Add the following code to your index.cfm page:

<cfquery name="qArtists" datasource="cfartgallery">
SELECT firstName, lastName, artistID
FROM artists
</cfquery>
<cfdump var="#qArtists#" />

So, what's this? Using the previously mentioned cfquery tag, we create a new query using the datasource name supplied within the administrator.

All SQL code, whether it's an UPDATE, SELECT, INSERT or DELETE, goes within the cfquery tags.

We have given the query a specific name, in this case 'qArtists'. We'll use this name to reference the query and obtain data from the object, which is what we are doing in the next tag, 'cfdump'.
This tag is essential in ColdFusion development, and will enable you to view everything from strings to complex structures, arrays, and objects.

Save the file, and view the results in your browser.

Viewing the results of your query using the CFDump tag

The query object is now visible on the page, showing the resultset, the execution time, if the query has been cached or not, and the sql used to obtain the results.

Loop through the data

So now we have the data, what can we do with it?
Let's loop through the query and display the names in a list, using the cfloop tag (I told you the tags were easy to remember).

Add the following code to the index.cfm page, underneath the query dump:

<ul>
<cfoutput query="qArtists">
<li><a href="page2.cfm?artistID=#artistID#">#firstName# #lastName#</a></li>
</cfoutput>
</ul>

Looping the results of your query using the cfloop tag

Nice and easy. So far you have created and displayed a string variable, run a query against a database, dumped the values and output the results using a loop, all in about 12 lines of code.
The beauty of ColdFusion development is the fact it's quick, rapid development, and easy to understand.

Persisting data and the Application scope

One important part of ColdFusion development is the ability to persist data, information and variables across the application. This can be achieved easily by using the Application scope, and the Application.cfm page. This page sits in the root of your application and is called on every page request, meaning that all data contained within it is available on every page. This is perfect for creating truly scaleable, dynamic applications. One real world example is to turn the datasource name into a variable.

Create a new file named 'Application.cfm' in your web root, and add the following to it:

<cfapplication name="myApplication" />
<cfset application.dsn = 'cfartgallery' />
<cfdump var="#application#" />

Open up the index.cfm page in your file editor and change the datasource name to use the '#application.dsn#' variable you have just created, so the code now looks like this:

<cfquery name="qArtists" datasource="#application.dsn#">
SELECT firstName, lastName, artistID
FROM artists
</cfquery>
<cfdump var="#qArtists#" />

Save the index.cfm file and view it in your browser.

Viewing the application scope using the CFDump tag

You can now see the Application scope has been dumped onto the page from the Application.cfm file, and the query still works using the variable as the datasource name.

URL variables and validation

We created a link within the loop to page2.cfm, so we need to create that page and save it within the web root. We are sending through the artistID variable, and we want to run a new query to pull out art works by that particular artist.

Add the following code to the page2.cfm file:

<cfdump var="#url#" label="URL Scope" />

<cfquery name="qArt" datasource="#application.dsn#">
SELECT artName, description, price
FROM art
WHERE artistID = <cfqueryparam cfsqltype="cf_sql_integer" value="#url.artistID#" />
</cfquery>
<cfdump var="#qArt#" />

Building on what we have already learnt, we are dumping and displaying the content of the URL scope. We can see that it holds the parameter we have sent through in the URL. There is a new query running a SELECT statement from a new table 'Art', pulling out records where the artistID matches that sent through in the URL.

There is an important tag nested within the query called cfqueryparam, which is an invaluable method in avoiding SQL injection of values passed through the URL or FORM scopes. If you specify any optional parameters, this tag perfoms data validation on the type being sent through.

A final cfdump tag displays the query object, and this time also shows SQLParameters sent through in an array object.

Viewing the query using the cfdump tag

Add the following code below the query in page2.cfm to once again loop through the data:

<cfif qArt.recordcount GT 0>

	<cfoutput query="qArt">
	<p>#artName#<br />
	#description#<br />
	#price#
	<hr />
	</p>
	</cfoutput>
	
<cfelse>

	<p>Sorry, there are no records that match your criteria.</p>

</cfif>

The loop is the same as that previously written in this tutorial, the only difference being the cfif tags wrapped around it, which will only run the loop if there are records within the query results.

Creating images is easy

One of the latest tags within ColdFusion 8 is the cfimage tag, which allows developers to create, display, save and manipulate images on the fly. So much can be done with this fantastic tag, but I will show you one simple real life example for it's use.

Creating your own CAPTCHA image has never been easier than this. Create a new file called image.cfm, and paste in the following code:

<cfimage action="captcha" difficulty="medium" fontSize="20" 
width="250" height="80" text="ColdFusion" />

From one ColdFusion tag, you have created your own CAPTCHA image and displayed it directly on the browser.

Creating a CAPTCHA image in ColdFusion 8

ColdFusion References and Documentation

You now have ColdFusion 8 installed, you've touched the surface of basic tags and variables, you've run a query and helped protect it with validation.

To explore the other tags, examples of use, and other included functions, you also have the ColdFusion documentation installed on your machine (assuming you selected the 'ColdFusion 8 Documentation' option within the installation steps), which you can access from the following local address:

  • Livedocs http://localhost:8500/cfdocs/dochome.htm
  • CFML Reference http://localhost:8500/cfdocs/htmldocs/help.html

If you unchecked this option, or perhaps you are developing on a different machine, the livedocs are also available for you online at the following address:

http://livedocs.adobe.com/coldfusion/8/htmldocs/index.html

ColdFusion is well known for it's large and friendly community. There are a plethora of forums, blogs, feeds and groups to read, join or ask advice in, so be happy in the knowledge you are never far from an answer.

Open Source CFML - Get Railo

One option for a quick, clean CFML application server is Railo, the new open source CFML engine. For this tutorial, we will be using the Railo Express package, and installing on a localhost web server. Railo is a small, self-contained CFML engine which uses all of the tags and functions included in Adobe ColdFusion, plus a few more that aren't. The final download is so small and compact, you can store it and run the server from a USB stick, which I do, so you can develop and play with CFML on the move.

Download Railo

You can download the Express version by visiting the Railo download page, and select the release relevant to your operating system

Download Railo Express

Now that you have the zip file opened, extract the contents to a location on your hard drive. I typically tend to place it in the root of the C: drive, although you can place it anywhere that best suits you. I personally find that the folder name generated from the zip file extraction is too long. You may wish to keep it as it is, e.g C:\railo-3.1.0.012-railo-express-6.1.0-3-1-with-jre-windows, or you may wish to rename it to C:\railoExpress, or something else easier to remember. Within the extracted folder, doubleclick on the 'start.bat' file ('start.sh' if using Linux). This batch file will set up the server for you, creating everything you need to be up and running in seconds.

Railo Start Command

As you can see from the command prompt at the very end, the server has been created for you on port 8888. Using your browser of choice, go to http://localhost:8888/. Straight away, you can see that the default index.cfm page displays and 'dumps' data, variables and scopes for you to show the install was successful.

Railo Index Page

At the top of the default page is the link to the Railo server administration console, typically 'http://localhost:8888/railo-context/admin/index.cfm'.
I'd suggest you bookmark this link to ensure you always have it to hand. You may end up replacing or overwriting the index.cfm page, and you don't want to risk losing this link.
Click on the link to proceed to the administration pages.

Your are provided with two options for Railo administration; Web Administrator (which configures settings per website) and Server Administrator (which configures the global settings for the entire server). Select the 'Server Administrator' option, and create your login password for the account.

The settings within the Railo administrator are similar to the ColdFusion admin interface, so finding your way around in either will be easy.

Any .cfm files you write for your Railo server need to be placed within the following folder: C:\railoExpress\webroot (although this will be different if you called your Railo folder something else).

The Last Word

Throughout this tutorial you have set up two CFML servers, experienced the ease of ColdFusion coding, and gained some knowledge of the Application scope. So, where to from here? I could have easily written for another 500 pages or so sharing a lot more code, objects and functions with you, and I look forward to sharing more with you soon, but in the meantime here are some very useful resources for you that you may like to visit:


Related Posts

Check out some more great tutorials and articles that you might like

Enjoy this Post?

Your vote will help us grow this site and provide even more awesomeness

Plus Members

Source Files, Bonus Tutorials and
More for $9 a month for all TUTS+
sites in one subscription.

Join Now

User Comments

( ADD YOURS )
  1. PG

    Shuuun May 6th

    We are using this at wort… i dislike it realy… <3 php !

    ( Reply )
    1. PG

      Shuuun May 6th

      No edit Button :P

      Why i dislike it?

      I think there are only very rare ways to get a mvc with Coldfusion.
      Especaly if you are not some kind of professionell in it! All theese html Tags with the cf Tags just hurt my heart every time :]

      Sure, cf got a great structure inside like these easy fast query output, but…
      Like i said, i heave to split my code in some kind of visual und functional layer.

      ( Reply )
      1. PG

        jem May 6th

        Most PHP frameworks (and a lot of the .NET I’ve seen as well) don’t really abide by a MVC architecture either… the MVC separation that you find in frameworks like Rails and Django doesn’t exist, a lot of it is all smooshed into one place.

        I haven’t seen any of this new CF in action yet, but we have a lot of vintage sites we still maintain at work that use it, and its a nightmare to work with (namely because as far as I was concerned it was dead!).

      2. PG

        Raul Riera May 6th

        If you are looking for a really good MVC approach and something really easy to use and extend. It’s just a quick download and you will have a full feature framework running in seconds, no additional files, no dependencies, no nothing.

        Please visit http://www.cfwheels.org.

      3. PG

        Shuuun May 6th

        I am not using any Framework in PHP o0 With ne new OOP of PHP5 you can build your own classes and use then when ever you want and for what project you want at any time. So its quite easy to get clean mvc code ;)

      4. PG

        Todd Rafferty May 6th

        @Shuuun: All you’re done is proven you haven’t looked closely enough at CFML. Writing CFCs are what you’re looking for with regards to OOP. There are SEVERAL MVC frameworks in the wild and all of them are active/alive. Fusebox, ColdBox, Model-Glue, Mach II, etc.

      5. PG

        Levin May 6th

        I Agree with u.Logic and UI all mix together~

  2. PG

    David May 6th

    I am ecstatic to see some Coldfusion showing up on here. Especially with Railo now being available it is so much easier for people to start using CF. Just like how Jquery is so well liked because of how it relates to CSS, CF is awesome in how it uses tags like HTML and even has built in ajax functionality with a simple Coldfusion Tag.

    With the growing use of Flex for RIA’s and the fact that both are Adobe products – the seemless integration is incredible.

    I hope to see a lot more CF tuts here int he future. Great job guys for making the decision to dip in the CF pool.

    ( Reply )
  3. PG

    Kevin Quillen May 6th

    I used to think Coldfusion was the bomb until I moved on to PHP. There are just some things that cannot easily be done in Coldfusion, not to mention its hosting requirements. But do what you want.

    ( Reply )
    1. PG

      Scott Stroz May 6th

      Can you give us an example of what ‘cannot easily be done in ColdFusion’?

      ( Reply )
      1. PG

        Checkers May 6th

        Ya finding a Job.

      2. PG

        Scott Stroz May 6th

        @checkers – I have not had any trouble finding a job.

        As for your comment about ‘when all he has to do is upload his .php file and everything will be good’ – the same can be said for ColdFusion, Railo, Open BD, etc… Of course, like PHP, you need to install it on the server before any of them will work – not really sure what your point was there.

        Not trying to ‘tackle every issue’, he made a vague comment about how there are things that are not easy to do with CF and I (as I imagine others) are curious to know what those things are.

        I find it funny that PHP fan boys trash CF whenever they get a chance and when a CF fan boy tries to get some clarificaiton on what was said we are ‘tryign to win everyone’

    2. PG

      Todd Rafferty May 6th

      @Kevin (Regarding Hosting Requirements): Have you looked at Railo? And, +1 What Scott said. Could you give us an example of something that CFML can’t do that PHP can? I can name one, IMAP for example, but what else?

      ( Reply )
      1. PG

        Checkers May 6th

        maybe he doesn’t want to be bothered with Railo, when all he has to do is upload his .php file and everything will be good.

        Since it seems like you like to make surveys for people maybe you will participate in mine.

        Why are you counting a reply like its a point? Are you trying to win something here?

        Just because someone doesn’t love your Beloved ColdFusion doesn’t mean you have to survey him and tackle every issue, all he did was post a simple comment. I don’t think he was trying to write a research paper by backing everything up with a fact.

        You could probably use google to find your answers instead of shaking it out of your ‘prey’.

        People have their reasons and/or opinions for not liking a language.

        You don’t need to win everyone to Cold Fusion.

      2. PG

        Todd Rafferty May 7th

        @Checkers: I’m not trying to “win” anyone. What I am trying to stop is misinformation that usually spews out of PHP Developers when they attempt to talk about another language.

    3. PG

      Kevin Quillen May 7th

      I used CF for nearly 4 years. In that time, our systems went from the very basic to advanced. We had decent seperation of code and presentation. But that’s not what bothered me really.

      We have a need for dedicated Coldfusion (on Linux) hosting, or at the very least, VPS CF hosting. Where most companies were LAMP at the time, we were LAMC. It worked well for us, until the hosting company we prefer stopped offering those plan(s), and only CF for Windows Server. None of us like Windows Server for web development that much nor did we have time to invest to learn the nuances of a new server OS.

      With that, whenever it was time to upgrade Coldfusion, theres a significant cost involved that no other platform I can think of has. So, 1 license * X servers just did not make sense financially. Only a percentage of projects could take advantage of new coding methods in CF8. On the other hand, if it were Rails, PHP etc based, we can upgrade for free.

      I don’t find that working with Arrays was as straightforward as it is in PHP. One thing that really gets me when switching back and forth between old and new projects is Coldfusion starts counts from 1, other languages start from 0.

      Its just the minor annoyances that add up. Not that PHP is perfect either.

      ( Reply )
  4. PG

    Matt Gifford May 6th

    Thank you for the comments and feedback so far, guys.

    @Shuuun – I appreciate your feedback. What MVC frameworks have you used in CodlFusion that may have put you off? There are so many to choose from now, that creating a truly structured application is easy. Fusebox, ColdSpring, Mach II, Model Glue to name a few.

    @David – thank you very much. It was a pleasure to write, and I’m currently finishing off the next tutorial. Flex and RIA integration will be covered at some stage. All tuts lead to something :)

    @Kevin – what things in particular? True, CF hosting isn’t as easily obtainable as PHP, but there are plenty of providers out there now, and very cost-effective ones as well.

    ( Reply )
    1. PG

      Shuuun May 6th

      I have not used any Framework at all. But every time i see ColdFusion Sourcecode i see the soup of html and cf tags.

      I am not in the CF scene, maybe its normal to program like this in CF.
      But if there are simple ways to use CF with mvc, its a good thing at all.

      ( If have realy never seen any kind of good code in cf in my eyes ^^ )
      Maybe its the point i would prefer to do some code in the Backend, in JSP, kinda more my language :D

      ( Reply )
      1. PG

        Connor2k May 6th

        Sounds like you aren’t familiar with CFC’s in coldfusion. There is great seperation of code and display for coldfusion.

  5. PG

    barry May 6th

    Ok, I’m new to this stuff. Which one should I learn? Coldfusion or PHP?

    ( Reply )
    1. PG

      Peewee1002 May 6th

      I would advise php becuase php is a more widely needed skill.

      ( Reply )
      1. PG

        Jon Hartmann May 6th

        On the other hand, if you are willing to relocate, there is a constant need for CF developers because they aren’t as common as PHP developers.

    2. PG

      Matt Gifford May 6th

      @Barry – learn both. You will obtain the knowledge of both languages, and increase your skillset, and therefore your marketability as a developer.

      ( Reply )
    3. PG

      bill May 6th

      PHP

      ( Reply )
    4. PG

      Douglas Neiner May 6th

      PHP… no questions asked. I know this will sound like a ‘dis on all CF developers, but the 2 times I have crossed CF since starting my business were both extremely negative examples to me of CF code. PHP is widely taught and used.

      ( Reply )
    5. PG

      Ben May 6th

      I’m surprised no one has mentioned Java. Many enterprise level applications out there are built on Java for it’s scalability in enterprise environments.

      Personally, I started out on PHP but am most recently moving to Java. I love the strictness of Java and it forces me to write some of the best code I’ve ever written following many design patterns I just wasn’t aware of when I was pecking away with my PHP.

      ( Reply )
  6. wow – people still use ColdFusion? I thought that went the way of the floppy disk.

    ( Reply )
    1. PG

      Todd Rafferty May 6th

      Alive and kicking. Adobe has released a document that shows a life path to CF11. We’re at CF8.0.1 currently and CF9 is in the works.

      ( Reply )
  7. PG

    Jarod May 6th

    I worked as a front-end developer for a company building a web application in Coldfusion. It’s a REALLY powerful programming language. What I’ve found is people either LOVE Coldfusion or they HATE it.

    To the casual noob programmer (like myself), I find PHP to be a much easier language to grasp, however I don’t doubt that Coldfusion is a more powerful language.

    A major turnoff for web developers looking into Coldfusion is not only its cost, but its hosting requirements.

    On the plus side of things, due to the lack of CF developers (at least in the US) there’s a lot of money to be made as a CF Developer. The only problem with that is, the lack of jobs as well as the competition in filling those jobs.

    Killer intro to Coldfusion.

    ( Reply )
    1. PG

      Connor2k May 6th

      For hosting, I am using Hostfolio.com and it is only $5.95 a month. Pretty cheap id you ask me. And that is with ColdFusion 8.
      Definitely a ton of money to be made developing with ColdFusion and I can pump out websites 3 to 1 over php. It’s quick, flexible, and I can do anything php, .NET, or other languages can do. And always faster.

      ( Reply )
  8. PG

    Raymond Camden May 6th

    I’d ditto Matt on the hosting stuff. You probably won’t find a 5 dollar a month hosting option for CF like you can with PHP. But basing your business on a host that charges as much as an imported beer is probably not a good idea. ;) There ARE affordable CF hosting options.

    ( Reply )
    1. PG

      Sam May 7th

      The Jedi Master has spoken! … people should listen…. and everyone here should check out Ray site – I practically live on it.

      Thanks for your support and everything you do to bring Coldfusion to the world Ray.

      ( Reply )
  9. Nice one Matt, can never have enough newbie stuff.

    ( Reply )
  10. PG

    Vladimir Carrer May 6th

    ColdFusion is probably most intuitive web programing languages. It’s very easy to learn. If you are web designer who want to learn to program CF is perfect.
    The main problem is the hosting. It’s very difficult to find cheap hosting because the license is not free.
    I program in ASP.NET and PHP but I love ColdFusion syntax.

    ( Reply )
    1. PG

      David Morgan May 6th

      That was my point with how perfect the timing of this is since Railo is now free and becoming easier to find for hosting. CF is very intuitive and using any of the frameworks mentioned above will provide incredible MVC options. Coldbox is another great choice not yet mentioned.
      In true MVC form – CFC’s are readily available through the community to easily access a long list of open API’s and more.

      PHP is great and has a large following and I have nothing against it – but I have always used mainly adobe products and chose CF for its ease of use – smooth transitional learning curve from html/css- its integration with other adobe products – and though I currently use eclipse – I cant wait for Bolt – the new IDE expected when CF 9 hits.

      Having followed Nettuts for the entire time its been up – It’s great to see CF added to the list of tuts available. We have seen PHP and Ruby among others – I am sure in future tuts you will also see how CF can be a great solution for a variety of projects.

      @Matt – while I am interested in gumbo and CF integration – I applaud your work so far and would be eager to see more of any CF related tuts. I am still a novice as I am more of a designer than developer still – so anything is welcomed learning!

      ( Reply )
  11. PG

    Toby May 6th

    Coldfusion can be more costly to start up, but it’s a great language after the initial investment, and now with Railo your startup cost for it is free! There are also some cheap hosting solutions out there like jodohost (3 domains, 2 db’s, and coldfusion for 10 bucks a month).

    Coldfusion has some awesome MVC architectures like Fusebox 5, model glue, and Mach 2 as well as implementing some great practices from the OO world. The best part about coldfusion is it’s easy to hook things up to it. It’s based on java, so you can extend any jar file into your cfml code, as well as extend .Net into it. A lot of CF can look like spaghetti code, but in reality there is so much more to the language then that.

    ( Reply )
  12. PG

    Felix May 6th

    Hi Guys,
    i’m really happy to see an article aboput ColdFusion here. ColdFiusion is great and there is an OpenSource Version too. RAILO http://www.railo.ch
    You can develop Applications so much faster in ColdFusion in less code than PHP! You can develop in HTML Tag syntax or you can use the cfscript solution. So you have both WAYS!
    Next is you can use Java Functions very easy, you can integragte C++ and .NET if you need and want.
    There are many Framewaorks around which are based on MVC patterns like ColdBox http://www.coldbox.com, Model-Glue http://www.model-glue.com, Mach-II, http://www.mach-ii.com and more.
    ColdFusion is easy to install and very easy for administration. You do not have to install this extension and this and so on. If you have a shop system or CMS based on ColdFusion it works and you do not have to install something else than ColdFusion itself.
    So try it and i recommed to use RAILO because you PHP guys like it cheap so you can get it. http://www.railo.ch.

    I like to see such articles about ColdFusion!

    Cheers Felix

    ( Reply )
  13. PG

    barry May 6th

    How long does it take a general n00b to learn Coldfusion? 6 months, a year? For instance, if I studied/practiced Coldfusion for an hour a day, 3-4 days a week?

    ( Reply )
    1. PG

      Matt Gifford May 6th

      @barry – it of course depends on the individual, but an hour 4 hours a week would easily be enough.
      This tutorial will have you up and running with the basics in about 45 minutes. There are a plethora of online resources to read through (the Adobe Livedocs is a great start) as well as other CF books you can find on Amazon.

      It’s such an easy language to learn, and extremely powerful. If you ever need any help, don’t hesitate to drop me an email, or find me on twitter: @coldfumonkeh

      ( Reply )
      1. PG

        barry May 6th

        Damn. I really appreciate it. I love this community!

        I’ll be sure to follow you.

  14. PG

    Joe May 6th

    So happy to see a CF tutorial!!!

    ( Reply )
  15. PG

    bill May 6th

    Coldfusion is a relic. Why pay for something like this when PHP is free and used by far more developers?

    ( Reply )
    1. PG

      Neil May 6th

      From a business standpoint, a Coldfusion client is more likely to be a long term client since there is less competing developers.

      I love Coldfusion, I haven’t programmed in CF for awhile though. I love some of the built in stuff like cfdocument and cfchart, I wished vb.Net had somthing like CFDocument!

      My only gripe with CF is the Fusebox methodology, most of the CF apps I have worked on used it and it sucks ass imo

      ( Reply )
      1. PG

        Kevin Quillen May 6th

        Fusebox is definately archaic given the newer frameworks and MVC methods.

      2. PG

        JimmyJames May 7th

        “a Coldfusion client is more likely to be a long term client since there is less competing developers”

        so your argument for using CF is that since no one uses it, your client will be desperate and forced to stick with you?

    2. PG

      Michael May 6th

      While it is true, CF 1-5 left a lot to be desired, CF6 was usable, 7 was good, and 8 is what a web application language is supposed to be. I’ve used PHP for a few years and ColdFusion for a few more, and I must say, I will never go back to PHP. Its good for simple, smaller apps, front end programming for a more robust language, or personal sites. But beyond that, stick to an actual application language (.Net, Java/jsp, etc), not a server side scripting language.

      It turns out that the initial cost of the system is offset by money saved by using fewer developers. Plus, with options like Railo and OpenBlueDragon, you can go the open source route.

      ( Reply )
    3. PG

      Skippy Dinglehoffer May 6th

      Gonorroeah is more popular than syphyllis, maybe you should line up for that as well

      ( Reply )
      1. PG

        JimmyJames May 7th

        This is quite possibly the dumbest argument I’ve ever seen. Well done skippy

    4. PG

      Todd Rafferty May 6th

      PHP IS FREE argument can go the way of the dodo thanks to Railo & Open BlueDragon.

      Next?

      ( Reply )
  16. PG

    crysfel May 6th

    i personally call this language “confusion” hehehehehe…. very funny!!

    ( Reply )
  17. PG

    WilGeno May 6th

    I see some good comments about ColdFusion (Adobe) and Ralio, but lets not forget New Atlanta’s BlueDragon CFML engine. It has several variations from the commercial BlueDragogn .NET and BlueDragon JX to open source OpenBlueDragon.

    http://www.newatlanta.com/
    http://www.openbluedragon.org/

    ( Reply )
  18. PG

    myDevWares May 6th

    Very interesting programming language. This is the first time I have actually read the syntax, and realized its full power and use. I must say I am impressed.

    But as a veteran PHP developer, I must say, wouldn’t Smarty + PHP be practically the same thing as ColdFusion? Smarty’s syntax is very similar, and has the added benefit of being able to separate design from code by using templates. Plus, you still have the full power of PHP.

    Personally, I’m a big fan of MVC, and separation of design/backend. It really DOES help the maintainability of a website, and saves time and energy in the long term.

    ( Reply )
    1. PG

      myDevWares May 6th

      I forgot to add: Smarty has a lot of built-in functions as well to REALLY speed up development. Plenty being added, and you can even make a custom one pretty easily.

      ( Reply )
    2. PG

      Michael May 6th

      It turns out that CF does allow for the separation of design vs backend, and it does it very well. This article only shows the basics. But CF allows for CFM files for front end work, with CFC files for backend.

      As far as templates goes, we were able to build a basic template rendering engine in a couple hundred lines of code at my shop. On one CF instance (and code base), for example, we run a couple hundred sites, each with a different template.

      Plus, it has a bunch of nifty features that allows for building some very advanced tools. You can specify that a query needs to be cached to speed up page loading. Using the built in variable scopes (Server, Application, Session, and Request), you can set up some very advanced caching, similar to memcache in performance (ours is custom to our applications, but it is done in under 100 lines of code). And, if performance becomes important, you can always drop down to cfscript or pure java (similar to assembly when using C++).

      All in all, ColdFusion is a web application language that knows it’s a web application language.

      ( Reply )
      1. PG

        myDevWares May 7th

        @Michael

        All that you mentioned there can be done with Smarty + PHP right out of the box without creating any new apps. And with a similar syntax as CF.

  19. PG

    Jose Diaz May 6th

    sweet entry Matt ;)

    ( Reply )
  20. PG

    Jeff Bouley May 6th

    I’ve been working with web technologies for 15 years. Started with perl, then asp, then java, then ColdFusion, also ASP.NET, . It is by far the most polished solution on the market (hence the initial cost).

    Supposedly Microsoft was interested in purchasing the technology from Allaire in the beginning days of the Web and ISAPI (App Server) solutions prior to its acquisition of ASP.

    CF is one of the most mature web technologies around as it has been consistently enhanced to support enterprise initiatives (one of the reasons it is very popular for intranet solutions). I understand the hosting argument and think Adobe should create an open source or free version of the product to compete more effectively with the PHPs out there. ColdFusion is continually maturing with version 9 on the horizon.

    You should check it out. As stated in the article it is free to use for dev purposes (developer version).

    ( Reply )
  21. PG

    Mike May 6th

    Coldfusion is powerful, elegant, ideal language for web development. I doubt that there are many (if any) web things that one can do in php, jsp, or .net that cannot be done in CF (and in general easier).
    Unfortunately it has one BIG draw back, there are very limited number of jobs. In US, UK and Australia there are a few but anywhere else: Canada, EU, Asia … there are virtually no CF jobs.
    It’s a pity that such a powerful language with a dedicated user base is dying by starvation.

    ( Reply )
    1. PG

      Lola LB May 6th

      Wow . . . that must be news to folks developing ColdFusion 9 and getting ready to write CFWACK9.

      ( Reply )
  22. PG

    Sacha May 6th

    Coldfusion is very limited. Basically, if you don’t already know java I would advise against using Coldfusion, because at some point you’ll need to hack some java together (coldfusion is a java layer) and realize it would’ve been easier to do everything in java from the start.

    Most of the major sites that were using coldfusion (like myspace) are moving away from it. They might keep the .cfm extension, but underneath it’s not coldfusion anymore (or at least a heavily modified framework).

    I’ve never learned Rails or Django, but I think it’s worth it to invest more time and learn a modern language or framework that doesn’t have coldfusion’s limitations.
    Plus the market for Coldfusion coders is much more boring (no fun startups use coldfusion :p) and probably shrinking.

    By the way, I had to work with coldfusion for one whole year so I know what I’m talking about.

    ( Reply )
    1. PG

      Todd Rafferty May 6th

      “Coldfusion is very limited. Basically, if you don’t already know java I would advise against using Coldfusion, because at some point you’ll need to hack some java together (coldfusion is a java layer) and realize it would’ve been easier to do everything in java from the start.”

      That’s false information. I am not a java developer and I’ve had no issues using CFML. It’s built on top of java, so if there’s something CFML can’t do, you CAN look at java options. You can also look at .NET options as well since CF8 has a .NET Bridge. You can also use webservices right out of the box as well.

      I can see that one whole year did you a lot of good. What did you need inside CFML that you couldn’t do and had to dig down to java during that one whole year? Please… tell us.

      ( Reply )
  23. PG

    Sacha May 6th

    Oh and here’s a concrete example of colfusion’s limitations: if you need to manipulate XML objects you’re stuck with a few basic functions, but as soon as you need something more advanced you need to code in java. Actually it’s a common pattern in coldfusion tutorials: as soon as there’s something a little bit complex that needs to be done, the java comes in.

    ( Reply )
    1. PG

      Todd Rafferty May 6th

      There are several tags / functions geared towards XML. Your ‘example’ is too generic and misleading. If you haven’t checked out Ben Nadel’s website, you should… he’ll rock your socks with CF / XML and bench press you at the same time.

      ( Reply )
    2. PG

      Mike May 6th

      and that’s exactly my point, if there is something you can’t do in CF (which at this point i don’t know, because you haven’t show us exactly what you couldn’t do so people more knowledgeable can show you the light) CF can be extended by accessing the underlying java layer.
      Regarding myspace again you are making the wrong case. The new team was trying to replace an older technology (CF 4.x or 5) with a newer one .net first and second their original design had not envision the success and (maybe) need for scalability. If the same task would have been given to a similar competent cf team and .net team then and only then you can compare the 2 solutions and decide if one platform is better then the other.
      I have nothing against java, php, .net or any other technology. What i dread are people who either have no clue what they are talking about or just like to throw mud for fun.
      Unfortunately it seems that you are winning :(

      ( Reply )
    3. PG

      dave May 7th

      show us what you mean? coldfusion has wonderful tools to deal with xml, I have yet to come across and piece of xml it couldn’t handle and it’s much easier to use than php.

      ( Reply )
      1. PG

        Sacha May 8th

        Here you go, an example of how you need some java just to copy an xml node from one object to another:

        http://www.bennadel.com/index.cfm?dax=blog:701.view

      2. PG

        Todd Rafferty May 8th

        @Sacha: Whoa, that Javacast() was some hardcore java there. I’m sorry, but all that’s doing is making sure it’s an integer. THAT’S IT. Everything else if CFML. o_O

  24. PG

    Joshua May 6th

    finaly, something on coldfusion.

    ( Reply )
  25. PG

    sam May 6th

    Not, bad. But ASP.NET 3.5 beats CF and php hands down..

    ( Reply )
    1. PG

      dave May 7th

      sure if you have your head up m$’s *ss and you want to be tied to a crappy windows enviroment which you can never escape from and you like m$ writing code for you (look at a frontpage site and tell me that is a good thing!), then yeah have fun.

      ( Reply )
      1. PG

        yoddha May 21st

        first of, dave you DO KNOW that frontpage died like, a million years ago. And EVERYBODY hated that program, even the tiny peepz at MS.
        And incase you didn’t know that, you propably haven’t heard of there new set of tools Expression Studio, even have PHP support ;)

        asp.Net 3.5 is really great, but at the same time very huge, and thus might be much to handle. then again .net MVC looks really interestin and promising =D

  26. PG

    Glenn May 6th

    Way cool seeing CF at nettuts!

    And for those of you who don’t know, Ray Camden (an earlier poster) is a CF GAWD! Ask him if CF is dead. :D

    ( Reply )
  27. PG

    dbrennan May 6th

    I love Coldfusion, it was the first language i developed in at college, and coming from HTML & CSS. I found the bridge over painless, the language just makes sense for me. I can build a full blogging system in Coldfusion, but i cant even get my head around it in PHP. Then there were also people in my class that could do amazing things with PHP and just could not understand Coldfusion. I would recommend Coldfusion to any one that is looking for a step up from HTML and are wanting more dynamic solutions.

    ( Reply )
  28. PG

    Mason Sklut May 6th

    Isn’t ColdFusion development a bit outdated? Most of us use PHP Frameworks nowadays ;-)

    ( Reply )
  29. PG

    Opy May 6th

    Yes, keep it comin’ Please!

    ( Reply )
  30. PG

    Baz May 6th

    Coldfusion has two open source FREE projects: Railo and OpenBD (open blue dragon)… PHP only has one open source project so according to my math it is less opensource :)

    ( Reply )
  31. PG

    Stephanie May 6th

    Thank you so much for a Coldfusion tutorial! I kind of got pushed into learning Coldfusion for my job. I didn’t realize all that it could do and that it is actually a pretty powerful language until I had to learn it.
    I think Coldfusion is becoming more popular and am glad to see a tutorial like this!

    ( Reply )
  32. PG

    Travis May 6th

    I am taking a Coldfusion class in College. I don’t really care for it, I can see where it has some advantages but I guess since I always have been a PHP guy, I feel I have no use for it when I can create an app that does the same exact thing with probably less code and less loadtime.

    I mean really whats more easier

    or
    $animal = ‘dog’;

    If one day a job oppurtunity came up that requires CF, I would gladly take it. Just not what I prefer… I guess

    ( Reply )
    1. PG

      Matt Gifford May 7th

      @Travis – you can do exactly that in ColdFusion as well.
      It wasn’t covered in this tutorial (although I could easily have written pages and pages of information), but ColdFusion has cfscript which allows you to write code without the cftags, so in reply to your comment, you CAN do the following in CF:

      var animal = ‘dog’;

      I’m hoping to cover cfscript in a future tutorial

      ( Reply )
  33. PG

    CF Guy May 6th

    Travis, you know you can just do this in CF if you’re using cfscript syntax:

    animal = ‘dog’;

    ( Reply )
  34. PG

    dave May 6th

    It’s amazing how ignorant some php developers really are, especially the ones who insist php is better because it’s free. Maybe if you weren’t a php developer you would be making more money and wouldn’t have to rely on your lively hood off of free products. And I really can’t think of anything in this world that is better because it is free…. ok well except beer…

    Jobs: sure there are lots of php jobs out there and there are more php developers than jobs so you get the simple supply and demand scenario. You can have your $20 an hour php jobs and I will take my high paying coldfusion job over that any day. Most php developers I know make about 40-50k a yr and most cfm developers I know make +100k… let’s see which do I want? eenie meanie minie moe….

    free coldfusion: railo flat out rocks! And if you are a student or school you can get a free license for adobe’s coldfusion. and then there is openbd which i probably will never use because of the cfm cancer otherwise known as vince.

    I make my $$ based upon how much I get done and the fact is that I get it done way faster with cfm than weak ole php and so that means that I make more so even buying adobe’s cfm I still profit more money over time saved. And to the guy who says it takes longer to do in cfm than php is a quite delusional.

    the power of php: what power? really….. what power?

    What can php do that coldfusion can’t?
    Sure it is a bit easier to write in oop in php but lets be real here…. 99% of you who “think” you write in oop are writing something more like “soup” than oop.
    But you can write good oop in cfm just fine and part of the charm is that you have the choice to write things how you want to. Hell if you wanted you could write your entire app in java or .net but run it as coldfusion, sean “the mack daddy of daddies” even got php running in coldfusion.

    ok so the main argument has always been that php is better because it’s free, well now coldfusion is free to so lets see what else.

    cheap hosting: ok sure there are more cheap hosting options. Any serious developer won’t be using cheap *ss hosting for their clients that’s just lame. Get your own box and make sure your clients aka lively hoods, sites are always running strong and smooth, neither of those can you reliable expect from a shared host. Or spend a few hundred bucks and buy a cheap server and have it co-lo’d and make some $$ of of hosting and have a better hosting solution for you and your customers.

    some basic tasks:

    image resizing: can php out of the box resize an image? no it can’t without using additional libraries. Can coldfusion? why yes it can! It can resize, sharpen, flip, add text, make a captcha, get image metadata, etc… and can do it in 1 line of code.

    pdf generation: can php whip out a pdf on the fly without pulling libraries in to do the job and be able to do it by simply wrapping the desired output with a single tag? I didn’t think so, coldfusion can! it can also manipulate pdfs and quite a few ways.

    convert videos:
    Lets see php with no add-ons or libraries take a video file & upload it and then convert that video file from whatever format it is into an flv and display it back in the brower in 2 lines of code…. oh wait it can’t…. bummer (railo cfm can do this)

    flash presentations via browser:
    can php generate a full fledged interactive presentation from your db data? no not without help but cfm can!

    java:
    can you write or call java code right in your php code if you need the extra power of java? of course you can’t, php is just a tag runner. Now coldfusion compiles down to the same byte code as jsp so you can write your app quickly in coldfusion and when you need java just write it in there or include your java library which gives you all the power you could ever need. Some brainiac on here earlier thought that having to tap into java was a bad thing but actually being able to is a great thing and if you don’t understand why then I’d suggest you whip up a shiny new resume in php and take it down to the local taco bell where your special skills will have the chance to really shine.

    .net:
    can php call and run .net code natively? again of course not(wow a common theme isn’t it). Coldfusion can do this as well.

    ajax:
    cfm does have built-in ajax.. jquery is better but there are some good tags in there.

    zip:
    can php take a file and zip it or unzip without help from a a plugin? nope.. again 1 simple line of code in cfm.

    I could go on and on and yet I still don’t see really what php can do that is any better? Personally I have nothing against php just the ignorance of a lot of it’s users, if you are going to claim it king then have some ammo that isn’t bs. There would be a huge # of php users who if they got some actual facts and not bs pissings in the wind from some mis-informed fool that would like the language. Some people like php syntax and some don’t, same with cfm.

    When I am bidding on a project the best thing that can happen is finding out that I am up against a php shop, makes it a “gimme”, not even a good fight. The only one I worry about is ruby.. that’s a harder battle. Going against php is as easy as shoving a fat kids face in a cake…the face is already there hoovering just on the edge taking a wiff & just needing a bit of a shove.. just to damn easy lol
    So you all keep working in php so I can always have easy pickins!

    Bottom line to me is that I can choose whatever I want and facts are facts and that fact is that I make a lot more money by using cfm then php and that’s my bottom line.

    ( Reply )
    1. PG

      Kevin Quillen May 7th

      It couldn’t really do any of this until Coldfusion 8 which came out when… late 2007 early 2008?

      ( Reply )
      1. PG

        Mike May 7th

        ahh, so u want to compare 2009 technology to cf 5. I guess that’s the only way u will win this argument. CF is dying (or at least not growing) not because it’s not robust, capable, scalable etc language. It’s because ignorance. And that’s a fight extremely hard to win, because ignorant people are well …ignorant.
        Not sure if Adobe is helping either…

      2. PG

        Kevin Quillen May 7th

        All languages have the same tools at their disposal, and if they don’t, someone comes along and builds it. Coldfusion didn’t support most of what you wrote until the last build, so its not like PHP has been out in the cold since it was born.

        True programmers can accomplish what needs to be done in any language anyway.

        Explain to me why sites like MySpace quickly jumped off CF in favor of ASP, Facebook/Digg/Web2.0 uses PHP? Other sites are either ROR or Python. You don’t see a lot of CF sites anymore. I believe this is -largely- based on the cost of Coldfusion and some of the overhead required to run it on a server.

        You’ve mistaken ‘blind ignorance’ for neutrality. I don’t prefer one or the other, I get paid either way. There are big trade offs on both.

      3. PG

        Todd Rafferty May 7th

        @Kevin: True, CF didn’t have some of the tools built in. The community stepped up and built some of them. For example, image manipulation. The community stepped up and built one utilizing java environment underneath and it’s still used to this day.

        It took a long time for us to get and even then, Adobe wanted to “limit” it on Standard boxes. We fought tooth and nail to get that limitation removed and other spoke up as well. Adobe listened and it was removed.

        I can’t answer why Myspace “jumped off” – they transferred to .NET, but I believe they used BlueDragon.NET to ease their way to .NET. That being said, who cares? The initial guy that wrote it all in CF made millions and laughed his way to the bank.

        I will agree with you that there’s not enough “social” presence exposing “CFM” enough, but they are out there. I know I see a lot of government / banks and such using it. We’re tired of that argument. One of the reasons why Rey Bango made http://www.gotcfm.com/thelist.cfm

        I don’t know what else to tell you. You’re adamant that your way is right and quite frankly, the truth is… there is no “perfect” language out there. You use whatever tool that gets the job done.

        I just happen to use Adobe CF / Railo for majority of my jobs. I have been for the past 10 years. It’s not going away anytime soon and thanks to Open Source initiatives of Open BlueDragon and Railo, even if Adobe were to walk away… we’ll still be here.

      4. PG

        Todd Rafferty May 7th

        Correction:
        “It took a long time for us to get [cfimage] and even then”

        Comment swallowed my > <

      5. PG

        Kevin Quillen May 7th

        What is Railo anyway? Is it like Smith Project? Is it faithful to CF8 Server?

        The problem, at least for us, is we aren’t mobile enough to switch technologies every 6 months being a company of 15 and rising.

        So even if I suddenly wanted to go back to CF, I couldn’t do that necessarily.

      6. PG

        larry c. lyons May 7th

        Lets see, calling Java objects directly since 2000. PDF’s since 2003, Image manipulation since 2003. Ajax since 2000 (with cfAjax.cfc).

        Actually given how easy it is to work with Java classes and packages in CF you could actually say that almost all of these have been available to CFMX since 2000 (.net is the exception however).

      7. PG

        Todd Rafferty May 7th

        Test. Not sure where my responses to Kevin are going. :[

      8. PG

        Todd Rafferty May 8th

        @Kevin: My comments still arent’ showing up. Not sure if they’re being moderated or not. Not sure why it is. Railo is an Open Source LGPL CFML engine. There are links on this thread. Open BlueDragon is another Open Source GPL CFML engine. Both of them are very compatible to CF8.0.1. Both of them have things that are missing that Adobe CF supports. Example, Railo doesn’t have CF8’s ajax support. Both teams accept patches if the community wants to pull support and help out.

  35. PG

    Saravanamuthu May 7th

    ur post is sweet & simple. I added this post in my bookmark. I ll share this with my new team joiners.

    ( Reply )
  36. PG

    Matt May 7th

    Confusion? Seriously…? It’s still around, but I don’t think CF is gettin m any new users. Opensource is where it’s at.

    ( Reply )
    1. PG

      dave May 7th

      it jumped up some 50,000 new users last year, so yeah it’s still around. The difference is that companies with serious needs are using it whereas php sites are generally small made by jr developers, certainly there are some great php developers out there but mostly what I see is complete crap code made by some graphic designer who started writting php a month ago and who now thinks after 1 month of coding that they are an OOP god. The amount of horrendous php code made by people who just need to stick to photoshop is one reason why I stay away from it. And the security of the php server is about as bad as windows & I don’t want to be constantly updating all my wp apps every week so that my server isn’t hacked.

      ( Reply )
    2. PG

      Ed May 7th

      I think you missed the part about Railo above…

      ( Reply )
  37. PG

    Gerald May 7th

    >>Opensource is where it’s at.

    Matt!
    Absolutely brilliant observation! Did you bother to RTFA or did you just succumb to the primordial urge of saying something blatantly and stunningly ignorant?

    Seriously, every time someone posts something about ColdFusion people cannot resist the urge to talk trash about it. I never understood this.

    ( Reply )
  38. PG

    Keith May 7th

    Thanks for taking the time to put this together. Nothing wrong with sharing information/tutorials on different thins, so…great work Matt.

    As for the rest of you who have your panties in a bunch over the “which is better, CF or PHP,” shame on you–your behavior is the IT equivalent of the “Sticker of Calvin Pissing on Ford/Chevy.”

    Most of your “arguments” are sophomoric, based on a level of fanboism, conjecture, and misinformation that would make Fox news proud.

    Man up nancies, STFU, and go back to work (if you have jobs, that is).

    ( Reply )
  39. PG

    Ed May 7th

    Well it looks like the Obama team likes it…

    http://blog.digitalbackcountry.com/2009/01/obamas-inauguration-brought-to-you-with-coldfusion-and-flash/

    And the US Senate loves it too – in fact they now provide an XML feed of Senate voting

    http://www.readwriteweb.com/archives/us_senate_votes_now_available_in_xml_-_bring_on_th.php

    The real problem with ColdFusion is – it’s too easy. The entry point is so low for anyone to start cranking out code that the technology gets the blame when these newbie’s (who can’t do .Net or Java) create lousy code and they point the finger back to the tool they used rather than admit they don’t understand proven software design and development techniques.
    I’ve been developing software for over 20 years and currently use PHP, RoR, ColdFusion and Java on a regular basis. I pick the tool primarily based on the client I am doing work for. I use the MVC paradigm for all of them including ColdFusion.

    But I am a little baffled by the posts above especially those who think they know what they are talking about…

    Many of the posts above are from misinformed people who don’t know or didn’t take the time to learn that in ColdFusion you create ColdFusion Components (cfc) for your business and database layer objects and you build the view in traditional .cfm files. The beauty behind building views in CFML is that it is a tag based language and it flows effortlessly among the html markup. But when I need to write business logic, I use CF scripting in my business layer and it is based on the ECMA standard (think JavaScript). You decide when to write the code using tags or when to us standard scripting syntax.

    So a lot of the arguments above simply do not hold water. And besides, ColdFusion is owned by Adobe who has the most penetration into all the major browsers with their Flash and Acrobat plug-ins – and the shear ease of integrating ColdFusion with PDF, Flash, Exchange, FTP, POP, SMTP, Java, .Net, Flex, Air, Web Services (SOAP/XML), LDAP, SMS, etc is just compelling compared to any other development tool out there.

    Also, let’s not forget that whether using the ColdFusion tag or scripting form of the language, what you write gets generated into full Java Byte Code you can run on any J2EE server. Try that with PHP or .Net!

    I am not knocking PHP or .Net because I do use them when required, but please people, be informed before judging or comparing technologies. ColdFusion Rocks in my opinion.

    ( Reply )
  40. PG

    dave May 7th

    “but php is better because it’s free”

    Great so what are you going to say when you tell your potential client that and the potential client says “well if free is better than why am I paying you 5k for this site when I can go to http://www.getyourFREEwebsitenow.com and get one for free?”

    ( Reply )
    1. PG

      Ah May 7th

      Are you 12? It sounds that way what with the run on sentences and grammar and all that.

      ( Reply )
      1. PG

        dave May 8th

        I was trying to write it at the php targeted age group on here which guessed was 12.

  41. PG

    Rafael May 7th

    CF > PHP simple as that

    ( Reply )
  42. PG

    I love CF May 7th

    Not sure if anyone mentioned this or not, but CF allows you to also write PHP code using as well using a Java library. And if you need to harness the power of Java, you can do so by tapping into the underlying Java. PHP, you’re stuck with whatever they give you. And also, PHP, code is not forward compatible, I realized that at the time that I started to get into it. Not to say PHP is bad, but it takes a lot of time to develop in it and you can do a lot of stuff with CF. BTW, someone mentioned there is 1 version of PHP, there is actually the PHP Java library that comes packed on Resin. Tests show that PHP is not that great on performance either, the Resin version is much faster and more efficient. For you PHP devs, you should switch!

    ( Reply )
  43. PG

    Sam May 7th

    YAY!!!…. finally some Coldfusion content here… THANK YOU!!!

    More… More… More… More… Please…

    I love Coldfusion and there is always something more to learn.

    ( Reply )
  44. PG

    iconz May 7th

    fantastic tut… I loved it… we need more of Cf… yay!!!

    ( Reply )
  45. PG

    Unibands May 8th

    I can’t tell you how nice it is to see a ColdFusion article on a site like this – well done.

    However, I think; because of so many misconceptions about what CFML and Coldfusion is, that you could have done a bit more with pointing people to resources on the web. I’ll try and do that below.

    http://www.getrailo.com/ – Open Source CFML
    http://www.openbluedragon.org/ – Open Source CFML
    http://www.adobe.com/products/coldfusion/ – Commercial CFML

    http://blog.reybango.com/2007/02/06/coldfusion-how-misconceptions-continue-to-plague-it/

    Cheers,
    Mikey

    ( Reply )
  46. PG

    Wassim May 8th

    The only problem/limitation I could see with CF is the Adobe policy towards making it more open/accessible or not. Microsoft is doing really a great job with asp.net and recently with asp.net mvc making them more open/transparent than ever.

    ( Reply )
    1. PG

      dave May 8th

      That is only the Adobe version, there are 2 opensource engines available and currently there is a cfm committee working on this.

      ( Reply )
  47. PG

    Karol Adamczyk May 8th

    I can’t believe the ignorance and prejudice against ColdFusion.

    I also don’t know how people can say PHP is easier than ColdFusion…

    Please for those who thinks so, compare the ways you would do a query and output it in HTML for example in both languages…

    There is a reason ColdFusion is always associated with “rapid development” you know!

    ( Reply )
  48. PG

    Matt May 8th

    I think most of the people that post here, especially those that think they are “hardcore” PHP developers, which I call “script kiddies”, are just completely dumb.

    Anybody with enough experience in th IT industry knows that the syntax does not matter. It can be PHP, Coldfusion, JSP, ASP.NET. After 10-15 years of development, I’m sure most of the script kiddies here will realize that PHP is not any better than Coldfusion. And Coldfusion is not any better than PHP. Most languages are based either on Java or C++, the syntax does not make any language better or worse, but it sure can make a language easier.

    ( Reply )
  49. PG

    Alex McCabe May 8th

    At a quick glance cold fusion seems incredibly easy to pick up. But as with most things, its probably easy to pick up difficult to master.

    2:19am is not the time for learning though. Will give it a crack tomorrow when i get up.

    I’d heard of coldfusion, but never really sure what it was. Thank you for this.

    ( Reply )
  50. PG

    dave May 8th

    @kevin above.. since the long post got cut out

    Kevin asked what top sites use cfm

    Who’s using ColdFusion?

    ColdFusion is in use at 75 of the Fortune 100 companies. Here’s a partial list of customers (with links to case studies) that rely on ColdFusion today.

    http://www.adobe.com/products/coldfusion/customers/
    http://www.thecrumb.com/2007/09/11/coldfusion-fortune-100/

    ( Reply )
  51. PG

    RNR May 10th

    Hello,

    After reading through the tutorial and scanning the comments, I’ve develop an interest in learning more about CF. However, I did a quick check at Amazon for books on CF and there’s very few, and most are outdated.

    Can anyone recommend some good sources for learning more about CF, either by book or website?

    Thanks.

    ( Reply )
    1. PG

      Matt Gifford May 11th

      @RNR

      Great news to hear you’re interested in learning more.

      Some useful books (available on Amazon):

      The Adobe ColdFusion 8 Web Application Construction Kit is a fantastic book. Big, heavy, but packed full of official CF goodness – http://tinyurl.com/CF8WACK

      Packt Publishing have a ColdFusion 8 Developers Tutorial publication – http://tinyurl.com/CF8DevTut

      There is the hugely important and useful Adobe ColdFusion Livedocs site, which contains the reference dictionary for all CF tags, functions and processes, including best practices and code examples – livedocs.adobe.com/coldfusion/8/index.html

      There is also a huge online community who are always willing and able to help.
      Some useful blogs to read are http://www.coldfusionjedi.com (Ray Camden), http://www.bennadel.com, http://www.houseoffusion.com to name a few.
      I’m sure other recommendations will come through to you as well.

      Please feel free to contact me at any point – http://www.mattgifford.co.uk, or twitter @coldfumonkeh

      I hope that helps in some way.

      ( Reply )
    2. PG

      Ed May 12th

      Charlie Arehart – a great guy and a ColdFusion heavy setup a site that has hundreds of recorded presentations given at various ColdFusion user groups around the world.

      http://www.carehart.org/ugtv/

      Check it out!

      ( Reply )
  52. PG

    jjeron May 11th

    after theoretically going through and skimming i found an error.

    ( Reply )
    1. PG

      Frank May 13th

      Where? How can ‘theoretically’ go through anf find an error?

      ( Reply )
  53. PG

    Kent May 11th

    Great tutorial. Especially the screen shots and explanation of the install of CF 8 and Railo. I work in a large shop and most of us don’t get to touch the admin side so this provided a look under-the-covers. I’m amazed at how powerful and easy to understand CF is. Prior to CF I was a windows programmer and we used Clarion. CF to me is the Clarion of the web world – turn out solid web apps quickly.

    ( Reply )
  54. PG

    Tyson Willey May 12th

    It’s nice to see CF on NetTuts. We’ve been using it for years at work and though I’ve had my qualms with it, I’ve grown to appreciate the simplicity of it.

    I’ve built everything from small, pro-bono sites to large scale, custom CMS’s and Inventory Management Systems with it. It’s far more powerful and advanced than people give it credit for.

    ( Reply )
  55. PG

    Phillip Senn May 12th

    Shock the ColdFuMonkeh!

    ( Reply )
  56. PG

    David Perel May 18th

    There are quite a few comments on this post… too many that I have time to read unfortunately.

    Here is my opinion about Coldfusion:

    I love it, despite the hosting hurdles I think CF is great for beginners who are stepping into programming and there is clearly nothing wrong with it for professionals either.

    We make our living by creating sites which use Coldfusion and we even managed to create two successful blogs with the language.

    On top of that I think the language is a lot cleaner than PHP and also quicker in terms of creating a site from a blank page.

    But each to their own. Its like Fireworks vs. Photoshop… each have their advantages and it just depends on you because they are both pretty capable programs.

    ( Reply )
  57. PG

    Marc Perel May 18th

    It’s great to see someone showing off the merits of ColdFusion.

    We punt Coldfusion on From the Couch when ever we can as it’s such a great language to work with; it’s easy to understand and since it’s tag and hash -based you can make super clean code too.

    I think if you have your queries and includes set-up correctly, site deployment is really fast; comparable to wordpress even.

    Great post

    ( Reply )
  58. PG

    amclean May 19th

    Having played with PHP for a good year before moving on to CF, I must say the speed at which I can crank out code in CF is incredible, and that’s not to say I’ve suddenly developed speedy powers – it’s all thanks to ColdFusion.

    The built-in debugging is top notch. The forms and validation are beyond simple (and in themselves save me hours of work). The javascript generation is amazing (especially considering my dislike of js). And the CFCs I find much easier to grasp than I ever did the multi-tier model in PHP, and so I find my code is much cleaner. That being said, there was something beautifully logical about PHP’s requirement that you have a closing tag for EVERY tag, something that CF does not require, but you get used to it.

    I found the best books to learn from were the Adobe ones, stating with the Adobe ColdFusion 8 Web Application Construction Kit Volume 1 (there’s also volume 2 and 3).

    I’ve also played around with Railo and Open BlueDragon. They work superbly but do not have 100% compatibility with CF8 code, for instance Railo is missing the validateAt=”onServer” attribute for text inputs. And of course there are no Flash/Flex forms either, but that’s not a huge deal.

    Great tut, lots of info. I’m actually following CF and Railo on my site as well. I wasn’t aware of the captcha function, will have to play with that :)

    ( Reply )
  59. PG

    Vitor May 20th

    Realy liked this tutorial, it helped me a lot!

    Thank you very much

    ( Reply )
  60. PG

    Adrian J. Moreno May 21st

    For those of you using MySpace as an example of a site “that moved away from Coldfusion”, you’re right and wrong. MySpace moved from Adobe ColdFusion, which compiles CFML code to Java classes, to New Atlanta’s BlueDragon.NET, which compiles CFML to .NET classes.

    While there are sections of MySpace that are purely .NET, many original and new sections are built using CFML. Just go to the homepage and click on the Take a Tour link or most of the links under the More tab. Wherever you see “.cfm?fuseaction=”, that’s a ColdFusion page using the Fusebox MVC framework.

    *CFML = ColdFusion Markup Language

    ( Reply )
  61. PG

    Sid Wing May 21st

    Having a backround (20+ years) as a coder in multiple laguages that range from machine code and assembler to “higher level” languages like COBOL, FORTRAN, Pascal, BASIC to “advanced languages” like C, C++, C#, Java, etc. over to “scripting languages” like PERL, TeXX, ReXX, HTML, JScript, PHP, etc. – I can honestly say I have never found a more powerful, easier to learn/use language than ColdFusion – It offers the new programmer a good starting language in Web App development as well as providing an “old codger” like me the advantages of tapping the “engine under the hood”.

    I’ve pointed a couple of my junior programmers to this article as a good supplement for the training I give them.

    Here’s one example: Junior programmer with basic HTML experience. 2 weeks of training time. His first solo project – gather info from a large amount of poorly generated XML data files, normalize the data, store in a SQL Database – generate multiple views of the data based on free-form search criteria (basically search on any field) as well as defined “views”.

    Total time for his first working application (working being defined as it met ALL minimum requirements) – 3 days – SOLO. He’s spent a week (5 days) total on it now and added more than 10 additional views and search function capabilities as well as realtime notification of data “issues”. He’d never even SEEN ColdFusion til day 1. Is his code pretty or optimized yet – no. That’s what revision 2 is for.

    In my world – we always – need a version to work RIGHT NOW – worry about optimization of code and clean-up in version 2. Our environment is fast paced, and we deal with multiple requirement generators for the same app. We never have 6 months to get the first revision of ANY app we write out the door – our turn around time for a first revision is always less than 10 days.

    The only dev language for web apps that I have EVER been able to do that with is CF.

    Thanks for providing the community with a GREAT tutorial article!

    ( Reply )
  62. PG

    simpleasthat June 23rd

    Rails > CF > PHP

    ( Reply )
  63. PG

    Nerocicuta July 9th

    I love CF

    ( Reply )
  64. PG

    เพชร September 22nd

    good point to start with codfusion

    ( Reply )
  1. Arrow
    Gravatar

    Your Name
    September 22nd