[Gllug] Interesting article on the MS monopoly
Tethys
tet at createservices.com
Fri Apr 30 08:46:08 UTC 2004
Nix writes:
>Like in er, C?
>
>/* Try using a visible slash star in here. */
>
>/* Plus there are other hidden *tricks*??/
>/ Is this in the comment? /* No, it wasn't. */
No, not like in C. BTW, using trigraphs to make obfuscated code is
considered cheating -- it's too easy :-)
But no, in C, the only invalid characters are the end of comment markers.
The same isn't true in XML. For example, the following is (to me) a fairly
natural way (and immediately obvious to the eye when scanned) to do a block
comment in XML:
<!-- This is a comment.
---- So should this be.
---- And this...
-->
However, the "--" at the start of the second line is invalid within a
comment, despite requiring a trailing ">" to make it an end of comment
marker. This has bitten me elsewhere, for example when commenting out
text that includes a double dash to simulate an em dash in ASCII -- like
the one I've just used.
XML could also *really* use a #if 0/#endif equivalent for block commenting
large volumes of text, regardless of whether they contain other XML comments.
The failings of XML in this regard have evolved into a tradition of not
using any markers to indicate that a line is part of a block comment. Try
looking at a tomcat config file[1] and working out which lines are comment
and which are not (without having to parse the file by eye).
Tet
[1] conf/server.xml, for example... bleurgh!
--
Gllug mailing list - Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug
More information about the GLLUG
mailing list