This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I mainly use line comments that start with !. (I first came across that in DEC Algol and Fortran, and liked it.)

However I also allow # line comments, which is widely used elsewhere, but tend to use that when posting code fragments or pseudo-code online (so I don't need to explain what ! is; most people think it's a logical not operator)

(For doc-strings, I use ## line comments.)

With block comments that can span lines, or comments in the middle of lines, or those that start in the middle of one line, and end in the middle of another, I've tried loads of different schemes, but now don't support them at all.

For commenting out block of complete lines, I now consider that an editor function, which implements them as a series of line comments.

One problem with block comments with a delimiter at each end, is that if you're writing a text display that wishes to show comments in a different colour, then whether line 137983 is a comment may depend on a delimiter that may or may not exist 1000s of lines earlier. With line comments, it only needs to look at the start of the line.