Best Practices in Coding

Writing clear, coherent code is important for the maintainability and extensibility of any application. Best practices in coding include using and adhering to style guides, commenting your code, and color-coding your code for easier readability.

Style Guide

You can use any style that suits you to code HTML or CFML pages. The key to writing clean code that's easy to reuse and update is to follow a style guide and keep your code consistent -- especially if you're working on a team, where someone else will be editing or adding to your code.

Refer to Chapter 6, "Best Practices for Coding HTML and CFML" for general coding guidelines for creating web pages and applications.

Commenting code

Commenting code well ensures that future developers, including yourself, know what your existing code does and how it works.

Color-coding tags

Studio installs a default color-coding schemes for HTML, CFML, VTML, SQL, and a host of scripting languages. This makes it easier to scan complex code. The color schemes are grouped by file extensions.

You can change color schemes and font styles using the Color Coding pane in the Settings dialog box (F8).