(Non) Nesting block comments

Michiel Helvensteijn m.helvensteijn.remove at gmail.com
Wed Jul 22 08:11:15 PDT 2009


yigal chripun wrote:

> IMHO, this is an ugly trick. it's less readable IMO and it just saves a
> cuple keystrokes. readability is more important than that. more over, this
> is completely unneeded (unless you program in notepad) since even the
> simplest of the (programmer) text editors has a shortcut to
> comment/uncomment a block of code. For instance, in Eclipse it's
> Ctrl+Shift+/

The point is not the amount of keystrokes. The point is that such a
construction is automatic documentation of the fact that either the one or
the other piece of code should be activated by the programmer (probably for
debugging). Of course, you can pretty it up a little:

//*///////////
A
/*////////////
B
//*///////////

But if you make this a convention in a project, every programmer will
immediately understand. The fact that it takes only one keystroke to make
the change is what gives the constructions its affordance.

-- 
Michiel Helvensteijn




More information about the Digitalmars-d mailing list