Best PracticesProperly Documenting Code


As you begin developing CFML code, I can't stress to you how important it is to document your code as you go along. Just like HTML, CFML provides special character combinations that indicate when a comment tag begins and when it ends. To start a comment, the <!- combination is used, whereas the --> combination is used to indicate that a comment has ended. For instance, suppose you write a block of code that draws two values from the database and averages them. Something as simple as adding a comment line such as the following

<!--This function draws the number of motorcycles in the database and the prices of all the motorcycles and creates an average price-->


can save you a lot of time when you have to revisit your code down the road. In addition, if someone else comes along and has to interpret your code, these helpers go a long way in helping them to understand what you were trying to accomplish.

Start developing your documentation skills now and you will reap the benefits of clear, understandable code for the rest of your career.



Special Edition Using Macromedia Studio 8
Special Edition Using Macromedia Studio 8
ISBN: 0789733854
EAN: 2147483647
Year: 2003
Pages: 337

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net