I like it because it visually distinguishes the code with comments and documentation.
If I want to comment on a bunch of code, this is:
/* int i; someCode(i); print i; */
This is much nicer, because I can either move the start / end part to include part of it, or simply delete two lines to include everything. In a different format, I cannot do this. As a result, it’s better to use a different style for documentation, because you never try to “uncomment” the documentation.
Now, with a rich editor, I prefer to comment on the code using line comments, but this is another argument.
Comments on the line for the code with comments
I like this better for commented code:
// int i; // someCode(i); // print i;
There are many reasons for this. Firstly, it makes it easier for one line to be uncommented (included). Secondly, it gives a better visual indication of what it has commented out, and then you get a block comment (which relies on syntax highlighting, as others have mentioned).
But thirdly, and most importantly, it allows you to safely include block comments in what you are commenting on.
Observe the difference in SO syntax highlighting when I comment on this:
public void messWithI() { int i; someCode(i); print i; }
With block comments:
public void messWithI() { int i; someCode(i); print i; }*/
With comments on the line:
// /** // * Does something to i and then prints i // */ // public void messWithI() { // int i; // someCode(i); // print i; // }
The reason you need a rich editor is that if you manually or manually delete comments, it will be a significant number of keystrokes. The IDE has utilities that do this for you (Eclipse is CTRL - / ), and advanced text editors have macros or at least vertical options.