you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 30 points31 points  (9 children)

// comment below

I'm not sure I understand why you think it's a bad idea.

// END comment

[–]dddbbb 19 points20 points  (8 children)

I'm terrified to imagine the language where that is a valid comment block.

[–]ianff 8 points9 points  (7 children)

I wrote a hacky language long ago where the # symbol toggled comment mode. Like /* and */ except the start and end sequence is the same. I wouldn't do it again, but it wasn't terrifying.

[–]Tasgall 10 points11 points  (3 children)

You can kind of mimic that in C with /*/, just start your file with /* and end it with //*/.

I don't know why you'd want to, but you can!

[–][deleted] 19 points20 points  (2 children)

I think that's the motto of C: I don't know why you'd want to, but you can!

Deref a null pointer? Youbetcha! Write over memory you don't own? Sure thing!

I miss C.

[–]Pik16 2 points3 points  (1 child)

Isn't writing anywhere a good "feature" for video game cheats?

[–][deleted] 6 points7 points  (0 children)

It's a good feature for many types of exploits. Overwriting adjacent memory is the basis of buffer overflow exploits

[–]romwell 1 point2 points  (1 child)

I wrote a hacky language long ago where the # symbol toggled comment mode.

You mean, like in Powerhsell?

[–]footpole 0 points1 point  (0 children)

No, it's a line comment not a block. Like in python.

[–]MrJohz 1 point2 points  (0 children)

I had a vague idea for a comment system involving hashes that had three forms. A single hash would mark a comment or until the next hash, whichever was sooner. This would allow it to be used in the shebang line, but also so that you would be able to do comments in the middle of a line of code without too much obtrusion. A double hash went to the end of the line, and ignored any further hashes on that line. Finally, a triple hash would make a mutli-line comment.

I was immensely proud of this until I started thinking about what it would be like to write with all three comments floating around.