ColdFusion Quicker Scripting At A Price

ColdFusion is a rapid application development language for the web, developed by Macromedia. It's not free, but many people say that it's more important to them to have the development speed that ColdFusion offers – and you can download a free 'developer version' to experiment with before you commit to anything.

No Need for a Test Server.

One of the nicer features of ColdFusion is that it comes with a whole application to help you write it the language. While it can be used with Apache or IIS once you're finished, this application effectively acts as your test server while you're writing your scripts, saving you quite a lot of trouble.

As a downside, though, ColdFusion on the web can sometimes be unreliable and slow, mainly because it runs on a Java framework. Its Java support does, however, make it capable of running on many more operating systems than it otherwise would be – for most purposes, having written a page in ColdFusion is as good as having used Java for it, but much less difficult. Since ColdFusion also uses the ODBC (Open Database Connectivity) standard instead of tying itself down to one database, this gives you a lot of choices.

In other words, you're sacrificing some of your website's speed in exchange for more choices and compatibility, and quicker development time.

Easy to Learn.

One of the things that makes ColdFusion easy to learn is that it isn't all that different from normal HTML: it acts more like a set of extension tags for HTML than like trying to get a programming language to do things and output HTML afterwards. This is because it was designed from scratch for the web – it's not just a normal language trying to be web-compatible.

For example, here's some code that queries a database and writes the fields it finds to the page:

SELECT * FROM table WHERE id = '1'

#result.field_from_query#

You can see that the 'cfquery' tag is used for sending queries to a database, while the 'cfoutput' tag adds text to the HTML. The text surrounded by hashes (#) is a variable. How are variables defined, you wonder? Like this:

Once you get used to thinking in tags, it starts to feel quite natural: ColdFusion just feels more HTML-like than other languages do.

Despite its simplicity, though, ColdFusion is considered to compete more with languages like JSP and ASP.Net than it does with PHP.

CFScript.

Unfortunately, trying to write dynamic web pages with nothing but tags can start to feel restrictive quite quickly, especially if you want to do something complicated – you end up with a hard-to-read mass of tags, reminiscent of trying to do a page's layout with tables. To solve this problem, Macromedia introduced CFScript, a Javascript-like language that you can use by putting it between tags. If you're already a programmer, you may find CFScript easier to work with than 'real' ColdFusion code.

Java.

One ColdFusion strength is that it doesn't just run on top of Java – it can also call Java classes using its createObject function and use any methods it needs to, with the results being put in ColdFusion variables. This will be very useful to you if you have existing Java code or know of Java code that you'd like to make use of – you'll get access to all the J2EE libraries as well as ColdFusion's own. It's this fact that has led Macromedia to market ColdFusion as "a scripting layer for J2EE". Of course, whether or not that excites you is a matter of personal preferences.

Integration with Other Macromedia Products.

If you already design your pages in Dreamweaver, it can be good to do the scripting in ColdFusion, as you get the advantages that integration between the two gives you. You can insert ColdFusion code into Dreamweaver files quickly and easily, and you can even use its built-in editor to edit the code however you want without messing up Dreamweaver's WYSIWYG view.

ColdFusion also integrates surprisingly well with Macromedia's flagship product, Flash – but don't let that lead you into developing nothing but ColdFusion-scripted websites with fancy Flash interfaces, whatever you do.

Clean Page Structure Headings And Lists

When HTML started, people put all sorts of things on their pages: there was a tag to say which font you wanted your text to be in, a tag to say you wanted it to be in the centre of the page, and so on. Now, though, that way of writing pages is out-of-date and very inefficient compared to keeping content and style separate using CSS.

What is CSS?

CSS stands for Cascading Style Sheets – it is basically a way of saying once what you want your pages to look like, instead of having to repeat it in HTML all the way through the document. In old style HTML, for example, this kind of code was a relatively common sight:

Welcome to my website!

I hope you enjoy your visit.

Now, though, you can remove the font tags altogether, and just have this:

Welcome to my website!

I hope you enjoy your visit.

At the top of your website, you put a style tag, like this:

Now, instead of having to say again which font you're using with every new paragraph, you've told the browser that you want every paragraph you've got to be in Arial.

Headings and Lists.

Thanks to CSS, you can make documents that are more 'semantically correct' – that is, they would make sense to a human reading them, instead of having to be weighed down with lots of extra presentation code. This has two great effects: it makes web pages smaller (and so faster to download), and it makes them simpler.

On a modern web page, the only things you should ever need to include apart from paragraphs of text are headings and lists. After all, web pages are just text, graphics and navigation put together in a particular order – there's no reason for things to be done as messily as they often are.

You use headings for the title and subtitles of your page – they're the HTML tags that begin with h. You might, for example, write

website title
article title.

Lists, on the other hand, can be used for pretty much anything else that isn't paragraphs of text. Instead of just putting links one after the other to make a navigation bar, for example, you should put them in a list, using the ul and li tags. Not only is this easier for you to read and add to, but it's also more compatible with non-graphical browsers.

A typical list looks like this:

item 1
item 2

Bold, Italic, and Images.

Of course, in practice, you'll need a few more tags. CSS lacks any good way of making individual words bold or italicised, so you can still use your b and i tags. Images, of course, still need a tag of their own too, although you might consider putting your images in a list if you have more than one.

In theory, at least, that still means that it should be perfectly possible to create a clean looking web page using only six tags: h, ul, li, b, i and img. And, yes, it is very possible – if you can stick to this attitude towards web pages, your page will be extremely clean, quick to download and fast to display. If you've ever sat and waited more than a few seconds for a page to load, you'll know how important this is.

Custom Stylesheets.

One more advantage of this approach is that it lets your users view your website however they want to. There are a surprising number of users out there who are elderly or just want some consistency on the web, and they have their own CSS stylesheets to add to pages to make text bigger, for example, or make the layout simpler.

Once you've written your page cleanly, you can even offer visitors a choice of stylesheets yourself – you can write more than one and then offer an option to switch between them. This makes redesigning your page much easier, if you ever need to, since you can simply swap one set of CSS for another and even leave the old one available for any visitors that prefer it.

Building Online Communities

When you're thinking of starting a website, you have a few problems. Where will you get content from? How do you keep visitors coming back? When you make your website an online community, though, you can solve all these problems at a stroke.

The Advantages of Communities.

On a community website, people come there mainly to communicate with the other visitors – your role is to set up the software that makes this possible, handling the technical side of things. Once your visitors make friends and find that people posting give them useful information (or just amusing writing), they will keep coming back, day after day, often even making time for it when they really ought to be doing something else. Even better, you don't have to pay anyone to produce content, because the members of your community are producing more content for each other than you could ever hope to commission commercially. The only rewards they ask for are the replies they get from other members.

Altogether, this adds up to an attractive proposition. Even better is the fact that the owners of online communities tend to quickly acquire cult leader-like status thanks to their ability to make the final decision when it comes to deciding who can be part of the community and who can't. Members don't even slightly resent supporting them, and will donate over and over again to make the website better – not only will they tolerate ads, but they'll click on them more in an effort to support you. There are forums out there that run entirely on community contributions: the Something Awful community forums and Metafilter community weblog, for example, charge $10 and $5 respectively per membership, and yet both have tens of thousands of members.

What You Need for Your Community.

Of course, thousands of members don't just appear overnight. To get people to start coming and writing in the hope of getting a response, you need to give them a reason to come to your website in the first place.

In many cases, your software will be what differentiates you. You're likely to be competing with other, similar community websites, and providing better features than the next guy can drive a surprising number of visitors to your website. If you listen to and act on every request, you can't do far wrong – find out the visitors' ideal features, and go out of your way to provide them, whatever they might be.

Another excellent way to build initial traffic to your site is to provide some data that's rare or difficult to get elsewhere, or to organise data in a way that will be especially useful to a certain community. You could, for example, compile live stock price data in a way relevant to a certain business sector, or organise TV listings so that they show all the times a certain show can be seen, whatever channel it's on. If you can find something unique, people will flock to it and love it.

Advertising a Community Website.

One thing to note about this kind of website is that they don't respond well to traditional promotion – few people will respond positively to an ad asking them to join a community. Why should they write for you when you're obviously only in it for commercial gain? Instead, you should make sure your community relates to something you have a genuine interest in, and then promote it casually in other relevant communities. An ideal situation is one where the owner of an existing website doesn't have the time for it any more, and you can move their community over to your site – this kind of 'evacuation' can give your site a thriving community overnight.

Once you've got a community, of course, don't underestimate how much promotion its members will do themselves: they will link it from everywhere they get a chance to put links, email things from it to friends, show it to people they know and get them to join – the possibilities are endless. If you care for your community properly, it will pay you back many times over.