Irish Flyer (2/11/2009)Given the inconsistancies noted, I guess it brings home the point that one should be consistant in coding. Either use the -- convention to comment a line, or use /* */ pairs for comments, but don't mix them. Consistancy is just good coding practice anyway.

I'm pretty consistent about commenting out comment blocks (--/* and --*/). It's the best way to remember which code was in the original block.

Irish Flyer (2/11/2009)Given the inconsistancies noted, I guess it brings home the point that one should be consistant in coding. Either use the -- convention to comment a line, or use /* */ pairs for comments, but don't mix them. Consistancy is just good coding practice anyway.

Good point. I tend to use the comments differently: -- to explain what (I think) the code is doing, /* */ to take out copies of code while I'm messing with it in development or to separate queries I use for testing. Most of the code in /* */ will get taken out in production.

As far as inline comments - I avoid them precisely for the reasons stated above. I do add them to large queries sometimes if I feel that parts of it need to be explained separately. Maybe I ought to exercise more caution in the future.

The comments Jesse refers to above are right on point. The problem with Grasshopper's in-line comments example is that too often they get left in the code when it is placed in production. When I do code reviews (and yes, we actually do them), code with those types of comments would be rejected.

Line (00) has an inline comment starting with the double dash so 2 an 3 are in the commentSame for (01) so 4 does print just like 1.Line (02) has an inline comment so the block comment starter is par of the comment and is ignored. Same for (04) and (10).Line (03) is not in any comment and gets executed. Same goes for line (11).Line (05) starts a block comment. Lines (06) and (07) are part of the block comment.Line (08) stops the block comment.

Regarding line (10). That is the same incorrect assumption that most of us made. Line 10 is not ignored. The comment begin marker causes the parser to search from the bottom up for a comment end marker, and finds it on line (10).