(Non) Nesting block comments

Michiel Helvensteijn m.helvensteijn.remove at gmail.com
Mon Jul 20 13:53:11 PDT 2009


D has the old C style block comments that start with /* and end with the
first possible */. But it also has nesting block comments, starting with /+
and ending with the *matching* +/.

The nesting block comments were a great idea, since they can be used
to 'comment out' any block of code, even if other block comments are
already present.

I was wondering, though. C++ compatibility aside, is there an actual use
case for the C style block comments anymore? Has anyone here written some
code lately where they thought: "I really need a comment here containing /+
or +/ without the matching delimiter! Thank <deity> for C style comments!"

(Yes, this is bikeshed stuff, and I don't really care. I like programming
language syntax discussions. Sometimes they are low barrier discussions.)

-- 
Michiel Helvensteijn




More information about the Digitalmars-d mailing list