[Zope] Comment on comments in DTML

Tom Cameron tom@mooball.com
Wed, 25 Jul 2001 18:51:47 +1000


This is not really a question, but a comment about comments :)

I find the <dtml-comment></dtml-comment> syntax for commenting code very
cludgy and not conducive to well commented code.

I have used Perl, Python, ASP, Java, JavaScript and VB before. All of these
languages have a very simple comment method that allows the coder to easily
place comments at the end of lines or in simple blocks. The Zope DTML method
too cumbersome for simple comments at the end of lines, and even blocks of
comments don't stand out too well.

I like to comment my code very much and wonder what other people think. I
understand that being HTML based the comment syntax may have to be an
inclusive tag, but perhaps a simple one would do.
I don't know much about the DTML interpreter so I may be off the mark here,
but some suggestions:

</ a comment />

<!--#
multi
line
comment
-->

<#>comment</#>

<!--#>comment<!--/#>

Acutally the second example almost works now, it stops DTML from executing,
but it then renders the code and the comment. The appropriate thing would be
to not render the comment at all.

Well there could be many good ways, I just think the more we encourage
people to comment their code the better all code will be.

Tom