[thelist] ColdFusion Remark Tip

Michael Roberto evolt at shriek.net
Fri May 10 10:40:10 CDT 2002


>At 08:21 10/05/2002 -0400, Colin Mitchell wrote:
>>Am I right in thinking that everything gets ignored until the
closing --->?
----
>On Friday, May 10, 2002 8:32 AM Andrew Shiel wrote:
>   If there's one, yeah. But if what you meant was <!-- stuff -->, and you
>put <!--- stuff -->, it's amazing how long you can spend looking for the
>problem. The mental process goes "That's a remark, it can't do
>anything...." as you go straight on past it.
----
You've found the difference between an HTML Comment(2 -'s) <!-- xxx -->
and a ColdFusion Comment(3 -'s) <!--- xxx --->

So why the difference, and why does the CF comment option even exist?
Well the code in an HTML Comment is simply remarked out when it comes
time for the webserver to process the code.  This allows the code to
pass through to the Source, and when someone views source they can see
the comments.

ColdFusion comments are remarked out by the ColdFusion Server, not the
webserver.  So anything you put in a CF Comment never makes it to the
webserver.  This can be helpful when you want comments that are only
for those reading the original files(developers) or when you want to
temporarily chop out some blocks of code, removing them using the CF
comment will cut down on the processing time by the webserver.

Personally I don't even bother using HTML Comments when doing any
CF development, in my eyes there's no need to pass comments on to the
HTML.  If anyone is viewing the HTML source with some purpose, its me
and I wrote the code so I know what I'm looking for.

Hope this helps clear up some of the specifics of CF/HTML Comments.

Mike

Mike Roberto
< shriek.net >





More information about the thelist mailing list