Some classes of question are made more interesting by banning comments. For example:
Others, such as this code-bowling question have special treatment of comments.
Many languages define delimiters for comments, but not all. So e.g. in CJam, the convention appears to be to comment your code by pushing a string with the comment text onto the stack and then popping it:
"These instructions do such-and-such";
That also has the same trivial semantics in GolfScript, although that has an explicit comment delimiter which is typically used for commenting code:
# This is a comment in GS
Some imperative languages allow any expression to be a statement, and so a simple
"This is a string";
is permitted but has trivial semantics. (E.g. JS allows this, and actually exploits it for "use strict";
).
Should these ignored strings be considered comments?
"string";
in CJam itself, not to mention other languages might more methods. \$\endgroup\$"string";
. No executable code can appear after a line comment, but that's not the case for a popped string. \$\endgroup\$var thisVariableNameIsNotReallyUsedButItStillProvidesFreeSpaceToStashEntropyIn
? \$\endgroup\$