Commenting templates with author data

We all know that we should liberally comment our code to allow other developers (and yourself) to quickly and easily find out what a particular section of code does. But what about a comment block at the top of the page so anybody can (at a glance) determine template specific information?

Here is an example of what I use at the top of my pages, this is pretty standard but I know a lot of people don’t do it.


I find the best thing is to either have this as part of a template for a new .cfm file, or as a snippet for easy access. I actually use snippets with built-in and custom snippet variables for the comment options.

The snippet I use for cfeclipse is:


Note the custom variable $${Purpose:} as well as the built-in snippet variables like $${CURRENTFILE}. You can read more about snippet variables here.

Post a Comment or Leave a Trackback

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*