This section offers some general guidelines for writing clean code. It also shows you how to use Allaire HomeSite or ColdFusion Studio to control your code style:
Wrong: <H1><A HREF="travel.html">
My travel diary</H1></A>
Right: <H1><A HREF="travel.html">
My travel diary</A></H1>
<TITLE>
tag appears in users' bookmarks or favorites lists when they bookmark your page. It also appears in the list of titles returned in a Verity search collection or by an Internet search engine.
This is particularly useful to show the organization of nested tags that contain
many attributes or additional tags. Use the Edit > Indent and Unindent
commands to adjust the indentation of selected text and tags.
In HTML and CFML, it doesn't matter how you capitalize tags, attributes, and values. But it does help to choose one style and be consistent.
<FONT FACE="Arial Black" SIZE="+2" COLOR="#FFFFFF">My Title</FONT>
In HomeSite or Studio, you can use the Options > Settings dialog box (F8) to control the capitalization and appearance of your code in these ways:
<img src="images/logo.gif" height=1 width=1 vspace=2 border=0>
<a href="directions.htm">
How to Find Us</a>
<CFFORM NAME="form1" ACTION="submit.cfm" METHOD="Post">
If the art of writing is rewriting, the art of maintaining a web site is reusing code wisely. Comments help immensely -- especially if someone other than you will update, inherit, or reuse your code.
Good:
<!--- Move to next decile --->
<CFSET x=x+10>
Not so good:
<!--- Increase x --->
<CFSET x=x+10>
Note | ColdFusion comments add white space to your pages; in ColdFusion applicati, use the CFSETTING tag to prevent this. |
The following tables shows a few of the most-commonly used character entities. The Special Characters pane has a more complete selection.
Special Characters | HTML Character Entities |
---|---|
Greater-than/angle bracket > | > |
Less-than/angle bracket < | < |
Ampersand & | & |
Quotation mark " | " |
Non-breaking space | |
Copyright symbol © | © |
Trademark symbol TM | ™ |
Registration symbol ® | ® |